{"id":27083782,"url":"https://github.com/geektimus/java-text-search-cli","last_synced_at":"2025-09-11T07:32:54.491Z","repository":{"id":82696794,"uuid":"173186176","full_name":"geektimus/java-text-search-cli","owner":"geektimus","description":"This application allows the user to index a given folder and search for words in it using an inverted index that maps words to file names.","archived":false,"fork":false,"pushed_at":"2019-03-01T11:54:43.000Z","size":701,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T03:19:11.404Z","etag":null,"topics":["challenge","cli","java-8","junit4"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/geektimus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-02-28T20:56:36.000Z","updated_at":"2023-02-13T19:51:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"d884650b-9bd5-49d0-83f9-62d851edbe5f","html_url":"https://github.com/geektimus/java-text-search-cli","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/geektimus/java-text-search-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geektimus%2Fjava-text-search-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geektimus%2Fjava-text-search-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geektimus%2Fjava-text-search-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geektimus%2Fjava-text-search-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/geektimus","download_url":"https://codeload.github.com/geektimus/java-text-search-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geektimus%2Fjava-text-search-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274595147,"owners_count":25314016,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-11T02:00:13.660Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["challenge","cli","java-8","junit4"],"created_at":"2025-04-06T03:19:12.121Z","updated_at":"2025-09-11T07:32:54.461Z","avatar_url":"https://github.com/geektimus.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Search CLI\n\n[![version](https://img.shields.io/badge/version-1.0.0-green.svg)][semver]\n[![Build Status](https://travis-ci.org/geektimus/java-text-search-cli.svg?branch=master)][travis_url]\n\nThis application allows the user to index a given folder and search for words in it using an inverted index that maps words to file names.\n\n## Getting Started\n\nThese instructions will get you a copy of the app to be used on your local machine.\n\n### Prerequisites\n\nTo build and run this small app you just need to have **Java 8** installed.\n\nTo check that you have Java installed just run this command:\n\n```\njavac -version\n```\n\nIt should show something like: `javac 1.8.0_162`\n\n### Installing\n\n- Clone the repository\n\n```\ngit clone https://github.com/geektimus/java-text-search-cli.git search-cli\ncd ~/search-cli\n```\n\n## Usage\n\nThis application expects one parameter which is required.\n\n### Parameter\n\n- Directory Path: This defines the directory to be used as the source of the files to be indexed.\n\nFor this project we have two options to run it from the console\n\n### Build the jar and run the tool (Recommended)\n\nYou need to perform two steps\n\n1) Build the jar using the gradle wrapper\n\n```\n./gradlew jar\n```\n\nThis command will generate a jar file named **\"search-cli.jar\"** inside `build/libs/` folder by default.\n\n2) Run the jar from the default location\n\n```\njava -jar build/libs/search-cli.jar \u003cpath-to-folder\u003e\n```\nThis will show you a prompt so you can search for words in the files inside `\u003cpath-to-folder\u003e` folder.\n\n### Run the app directly using gradle run task\n\n```\n./gradlew run --args=\"\u003cpath-to-folder\u003e\"\n```\n\n**Note:** This method is not recommended because the gradle daemon prints a progress bar while we run commands so the prompt will a mess to read.\n\nSomething like this:\n\n```\n./gradlew run --args=\"./src/test/resources/fake-directory\"\n\n\u003e Task :run\nLoaded 118 words\nsearch\u003e\n\u003c=\u003c====={file: ./src/test/resources/fake-directory/b-text-file.txt, rank: 100}\n{file: ./src/test/resources/fake-directory/a-text-file.txt, rank: 100}\nsearch\u003e t amet\n\u003c=========----\u003e 75% EXECUTING [13s]\n\u003e :run\n```\n\n## Running the tests\n\nIn case you want to run the tests it's as simple as running this command\n\n```\n./gradlew test\n```\n\n### Demo\n\n![Search CLI Demo](example.gif)\n\n## Built With\n\n- [Gradle 5.2.1][gradle] - Build Tool\n- [Java 8][java_jdk] - Language\n\n## Future Work\n\n- Try to improve the tool using Akka for file parsing and indexing.\n- Add hot reload to allow the user to add new files without having to restart the app.\n- Add stem logic to reduce the number of words to be processed/indexed as we consider words with the same root as the same word, i.e, run, runner, runners, running.\n- Update unit test to test the top 10 functionality.\n\n## Contributing\n\nPlease read [CONTRIBUTING.md][contributing] for details on our code of conduct, and the process for submitting pull requests to us.\n\n## Versioning\n\nWe use [SemVer][semver] for versioning. For the versions available, see the [tags on this repository][project_tags].\n\n## Authors\n\n- **Alex Cano** - _Initial work_ - [Geektimus][profile]\n\nSee also the list of [contributors][project_contributors] who participated in this project.\n\n## License\n\n[![license](https://img.shields.io/badge/license-MIT-blue.svg)][license]\n\nThis project is licensed under the MIT License - see the [LICENSE.md][license] file for details\n\n[travis_url]: https://travis-ci.org/geektimus/java-text-search-cli\n[gradle]: https://gradle.org/install/\n[java_jdk]: https://www.oracle.com/technetwork/java/javase/downloads\n[contributing]: CONTRIBUTING.md\n[semver]: http://semver.org/\n[project_tags]: https://github.com/geektimus/java-text-search-cli/tags\n[profile]: https://github.com/Geektimus\n[project_contributors]: https://github.com/geektimus/java-text-search-cli/graphs/contributors\n[license]: LICENSE.md","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeektimus%2Fjava-text-search-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeektimus%2Fjava-text-search-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeektimus%2Fjava-text-search-cli/lists"}