{"id":21016509,"url":"https://github.com/gsa/i14y","last_synced_at":"2025-05-15T05:32:56.845Z","repository":{"id":29955945,"uuid":"33502621","full_name":"GSA/i14y","owner":"GSA","description":"Search engine for agencies' published content","archived":false,"fork":false,"pushed_at":"2024-10-25T19:55:30.000Z","size":21783,"stargazers_count":12,"open_issues_count":12,"forks_count":23,"subscribers_count":14,"default_branch":"main","last_synced_at":"2024-10-26T18:01:18.983Z","etag":null,"topics":["maintained"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GSA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2015-04-06T20:02:28.000Z","updated_at":"2024-10-24T16:47:15.000Z","dependencies_parsed_at":"2024-01-08T21:51:57.367Z","dependency_job_id":"85442651-c66d-43f5-8fbf-751e9ca62a56","html_url":"https://github.com/GSA/i14y","commit_stats":null,"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GSA%2Fi14y","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GSA%2Fi14y/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GSA%2Fi14y/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GSA%2Fi14y/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GSA","download_url":"https://codeload.github.com/GSA/i14y/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225332354,"owners_count":17457710,"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","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":["maintained"],"created_at":"2024-11-19T10:13:45.965Z","updated_at":"2024-11-19T10:13:46.624Z","avatar_url":"https://github.com/GSA.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"i14y\n====\n\n[![CircleCI](https://circleci.com/gh/GSA/i14y.svg?style=shield)](https://circleci.com/gh/GSA/i14y)\n[![Code Climate](https://codeclimate.com/github/GSA/i14y/badges/gpa.svg)](https://codeclimate.com/github/GSA/i14y)\n[![Test Coverage](https://codeclimate.com/github/GSA/i14y/badges/coverage.svg)](https://codeclimate.com/github/GSA/i14y)\n\nSearch engine for agencies' published content\n\n## Dependencies/Prerequisites\n\n* Ruby\n\nUse [rvm](https://rvm.io/) to install the version of Ruby specified in `.ruby-version`.\n\n### Docker\n\nDocker can be used to: 1) run just the required services (MySQL, Elasticsearch, etc.) while [running the i14y application in your local machine](https://github.com/GSA/i14y#development), and/or 2) run the entire `i14y` application in a Docker container.  Please refer to [searchgov-services](https://github.com/GSA/search-services) for detailed instructions on centralized configuration for the services.\n\nWhen running in a Docker container (option 2 above), the `i14y` application is configured to run on port [3200](http://localhost:3200/). Required dependencies - ([Ruby](https://github.com/GSA/i14y#dependenciesprerequisites), and Gems) - are installed using Docker. However, other data or configuration may need to be setup manually, which can be done in the running container using `bash`.\n\nUsing bash to perform any operations on i14y application running in Docker container, below command needs to be run in `search-services`.\n\n    $ docker compose run i14y bash\n\nFor example, to setup DB in Docker:\n\n    $ docker compose run i14y bash\n    $ bin/rails i14y:setup\n\nThe Elasticsearch services provided by `searchgov-services` is configured to run on the default port, [9200](http://localhost:9200/). To use a different host (with or without port) or set of hosts, set the `ES_HOSTS` environment variable. For example, use following command to run the specs using Elasticsearch running on `localhost:9207`:\n\n    ES_HOSTS=localhost:9207 bundle exec rspec spec\n\nVerify that Elasticsearch 7.17.x is running on the expected port (port 9200 by default):\n\n```\n$ curl localhost:9200\n{\n  \"name\" : \"002410188f61\",\n  \"cluster_name\" : \"es7-docker-cluster\",\n  \"cluster_uuid\" : \"l3cAhBd4Sqa3B4SkpUilPQ\",\n  \"version\" : {\n    \"number\" : \"7.17.7\",\n    \"build_flavor\" : \"default\",\n    \"build_type\" : \"docker\",\n    \"build_hash\" : \"78dcaaa8cee33438b91eca7f5c7f56a70fec9e80\",\n    \"build_date\" : \"2022-10-17T15:29:54.167373105Z\",\n    \"build_snapshot\" : false,\n    \"lucene_version\" : \"8.11.1\",\n    \"minimum_wire_compatibility_version\" : \"6.8.0\",\n    \"minimum_index_compatibility_version\" : \"6.0.0-beta1\"\n  },\n  \"tagline\" : \"You Know, for Search\"\n}\n```\n\n## Development\n\n- `bundle install`.\n- Run `bundle exec rake i14y:setup` to create the neccessary indexes, index templates, and dynamic field templates.\n\nIf you ever want to start from scratch with your indexes/templates, you can clear everything out:\n`bundle exec rake i14y:clear_all`\n\n- Run the Rails server on port 8081 for compatibility with the\n  search-gov app:\n```\n$ rails s -p 8081\n```\n\nYou should see the default Rails index page on [http://localhost:8081/](http://localhost:8081/).\n\n### Code Quality\n\nWe use [Rubocop](https://rubocop.org/) for static code analysis. Settings specific to I14Y are configured via [.rubocop.yml](.rubocop.yml). Settings that can be shared among all Search.gov repos should be configured via the [searchgov_style](https://github.com/GSA/searchgov_style) gem.\n\n## Basic Usage\n\n### Create a collection for storing documents\n```\n$ curl -u dev:devpwd -XPOST http://localhost:8081/api/v1/collections \\\n -H \"Content-Type:application/json\" -d \\\n '{\"handle\":\"test_collection\",\"description\":\"my test collection\",\"token\":\"test_collection_token\"}'\n```\n\n### Create a document within that collection\nUse the collection handle and token for authorization:\n\n```\ncurl http://localhost:8081/api/v1/documents \\\n  -XPOST \\\n  -H \"Content-Type:application/json\" \\\n  -u test_collection:test_collection_token \\\n  -d '{\"document_id\":\"1\",\n      \"title\":\"a doc about rutabagas\",\n      \"path\": \"http://www.foo.gov/rutabagas.html\",\n      \"created\": \"2020-05-12T22:35:09Z\",\n      \"description\":\"Lots of very important info on rutabagas\",\n      \"content\":\"rutabagas\",\n      \"promote\": false,\n      \"language\" : \"en\",\n      \"tags\" : \"tag1, another tag\"\n      }'\n```\n\n### Search for a document within a collection\n```\n$ curl -u dev:devpwd http://localhost:8081/api/v1/collections/search?handles=test_collection\u0026query=rutabaga\n```\n\n## Tests\n```\n# Fire up Elasticsearch in search-services\n$ docker-compose up elasticsearch7\n\n$ bundle exec rake i14y:setup\n$ rake\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgsa%2Fi14y","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgsa%2Fi14y","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgsa%2Fi14y/lists"}