Skip to content

Setting up i14y with search gov for development

Martha Thompson edited this page May 6, 2022 · 1 revision

For a general overview of i14y drawers, start with the manual and the technical documentation.

If you need a local i14y Rails app to work with your search-gov Rails app, here's how to set that up. The search-gov app only needs to know the base URL of the i14y app, and that's configured in search-gov in config/i14y.yml. By default it expects the i14y url to be http://localhost:8081.

i14y setup

  • Follow the instructions in the i14y repo to get i14y up and running
  • Start the i14y Rails server up on port 8081 with bundle exec rails server -p 8081

search-gov site setup

  • In super admin, enable the "Gets i14y results" setting for your site (or use the i14y_enabled seed site)
  • Go to the admin center for your site and go to Content -> i14y Drawers
  • Click "Add i14y Drawer", fill in a handle and description for your new drawer, and click "Add"
  • Note the Handle and Secret Token values as you will need them in the next steps
  • Use the following commands to load example documents into i14y after replacing {HANDLE} and {SECRET_TOKEN} for each:
curl -vX POST -H 'Content-Type:application/json' -u '{HANDLE}:{SECRET_TOKEN}' http://localhost:8081/api/v1/documents -d '{"document_id":"Orochimaru","title":"Orochimaru","path":"http://naruto.wikia.com/wiki/Orochimaru","created":"2016-03-29T22:00:00Z","content":"Orochimaru (大蛇丸, Orochimaru) is one of Konohagakure''s legendary Sannin. With a life-ambition to learn all of the world''s secrets, Orochimaru seeks immortality so that he might live all of the lives necessary to accomplish his task. After being caught red-handed performing unethical experiments on his fellow citizens for the sake of this immortality, Orochimaru defected from Konoha rather than be persecuted for his ambitions, and for many years sought the village''s destruction in order to take revenge and demonstrate what he had learned. After several apparent deaths in the pursuit of his goals, Orochimaru realises his approach is flawed through Kabuto Yakushi, his former associate, and begins monitoring the choices and actions of his former apprentice, Sasuke Uchiha."}'
curl -vX POST -H 'Content-Type:application/json' -u '{HANDLE}:{SECRET_TOKEN}' http://localhost:8081/api/v1/documents -d '{"document_id":"Jiraiya","title":"Jiraiya","path":"http://naruto.wikia.com/wiki/Jiraiya","created":"2016-03-29T22:00:00Z","content":"Tsunade (綱手) is one of Konohagakure''s Sannin. She eventually gained the title of Konoha''s Slug Princess Tsunade (木ノ葉のナメクジ綱手姫, Konoha no Namekuji Tsunade-hime). Though celebrated as the world''s strongest kunoichi and its greatest medical-nin, the repeated loss of her loved ones caused Tsunade to abandon the life of a shinobi for many years. She is eventually persuaded to return to Konoha as its Fifth Hokage (五代目火影, Godaime Hokage, Literally meaning: Fifth Fire Shadow), where her skills prove invaluable to the village."}'
curl -vX POST -H 'Content-Type:application/json' -u '{HANDLE}:{SECRET_TOKEN}' http://localhost:8081/api/v1/documents -d '{"document_id":"Tsunade","title":"Tsunade","path":"http://naruto.wikia.com/wiki/Tsunade","created":"2016-03-29T22:00:00Z","content":"Tsunade (綱手) is one of Konohagakure''s Sannin. She eventually gained the title of Konoha''s Slug Princess Tsunade (木ノ葉のナメクジ綱手姫, Konoha no Namekuji Tsunade-hime). Though celebrated as the world''s strongest kunoichi and its greatest medical-nin, the repeated loss of her loved ones caused Tsunade to abandon the life of a shinobi for many years. She is eventually persuaded to return to Konoha as its Fifth Hokage (五代目火影, Godaime Hokage, Literally meaning: Fifth Fire Shadow), where her skills prove invaluable to the village."}'
  • Go to the search page for your site and search for "village" which should show all three documents in the results

Resources