The service currently exposes four endpoints:
/OpenSearchDescription- OpenSearch Description Document (accessing this endpoint provides descriptions for each other endpoint)/OpenSearch- dataset search, used by NSIDC Search and the ADE/Facets- facets to go with the dataset search/suggest- retrieve suggested phrase completions for auto-suggest/auto-complete
For the most part, these endpoints support queries following the
OpenSearch and relevant OpenSearch
Extension specifications. However, they each take an additional optional URL
parameter that is not in the standard, source. This service was originally
built to support both NSIDC Search and the
Arctic Data Explorer (ADE) in a single instance of the service, using the same
Solr store for metadata. The source parameter provided a simple way to
distinguish between the two client applications. ADE is now decommissioned, but
the source value of NSIDC may still be used by the NSIDC data search
application.
- Ruby (see
.ruby-versionfor the required version) - Bundler
- Ubuntu 14.04 (only required if setting up the Upstart service)
config/app_config.yaml contains settings for different deployment environments.
Each environment other than development merges in the common settings. You
may need to modify some settings in the appropriate section in this file:
relative_url_rootdetermines the path to access the service, e.g., with a value of/api/dataset/2, you can access the running service at http://localhost:3000/api/dataset/2solr_urlis the URL of the Solr core containing your datasolr_auto_suggestis the URL of the Solr core containing autocomplete data
- Clone the source code -
git clone git@github.com:nsidc/dataset-search-services.git cd dataset-search-services- Install the dependencies -
bundle install - Modify the
developmentsection inconfig/app_config.yamlso that it has the values you need (ifRACK_ENVis set to something other thandevelopment, the section matching its value will be used) bundle exec rake runstarts the service on port3000- The service can be queried via
curlor in the browser with an OpenSearch request, e.g., http://localhost:3000/OpenSearchDescription, which will provide a list of endpoints provided by the service and their required parameters
tasks/deploy.rake contains rake tasks to set up and start the service on a
Vagrant VM hosted on NSIDC's internal network. To set up the service outside of
this network, follow these steps:
- Clone the source code -
git clone git@github.com:nsidc/dataset-search-services.git cd dataset-search-services- Set
APP_PATHinconfig/app_config.rbto where you want the code to be run- the following steps assume the environment variable
APP_PATHis set to the same value used inconfig/app_config.rb
- the following steps assume the environment variable
mkdir -p $APP_PATHcp -R . $APP_PATHcd $APP_PATH; bundle installmkdir -p $APP_PATH/run/log- Set
ENVto your desired environment (development,integration,qa, etc.) - Configure the appropriate section in
$APP_PATH/config/app_config.yaml echo $ENV > $APP_PATH/config/environment- Create a search_services.service file in /etc/systemd/system. See the example file below, which
assumes the $APP_PATH is /opt/search_services
- The User and Group should be changed to whatever user/group will own the service
- Create a puma run file:
sudo mkdir /etc/search_services- Create a file
/etc/search_services/puma.rbfile; see below for an example. As above, this example assumes the $APP_PATH is /opt/search_services
sudo systemctl start search_services.service- the service must be able to write to
/var/logand/var/run/puma(the full paths of the relevant files can be seen inconfig/app_config.yaml)
- the service must be able to write to
- The service can be queried at using the
portandrelative_url_rootset in$APP_PATH/config/app_config.yaml- For example, if
portis10680andrelative_url_rootis/api/dataset/2, you can access the OpenSearch Description Document provided by the service at http://localhost:10680/api/dataset/2/OpenSearchDescription.
- For example, if
[Unit]
Description=search_services - puma application
[Service]
Type=forking
WorkingDirectory=/opt/search_services
RuntimeDirectory=search_services
PIDFile=/var/run/search_services/puma.pid
User=www
Group=www
# The command to start puma
ExecStart=/usr/local/bin/bundle exec puma -C /etc/search_services/puma.rb
Restart=on-failure
[Install]
WantedBy=multi-user.target
Configure environment, port, etc, according to your needs.
directory '/opt/search_services
environment 'development'
daemonize
pidfile "/var/run/search_services/puma.pid"
stdout_redirect "/var/log/search_services.puma.stderr.log", "/var/log/search_services.puma.stdout.log"
threads 1, 1
bind 'tcp://0.0.0.0:10680'
plugin 'tmp_restart'
restart_command "bundle exec puma"
workers 2
preload_app!
Notes on changes can be found in
CHANGELOG.md.
Instructions and notes for developing this project are in
DEVELOPMENT.md.
User Services and general information: Support: http://support.nsidc.org Email: nsidc@nsidc.org
Phone: +1 303.492.6199 Fax: +1 303.492.2468
Mailing address: National Snow and Ice Data Center CIRES, 449 UCB University of Colorado Boulder, CO 80309-0449 USA
Every file in this repository is covered by the GNU GPL Version 3; a copy of the license is included in the file COPYING.