dp-search-query
A Go application microservice to provide query functionality on to the ONS Website
/data?
URL Parameters
uris
[0..1]
types
[0..1]
/search?
URL Parameters
term
[0..1]
size
[0..1] default:10
from
[0..1] default:0
index
[0..1]
type
[0..*]
sort
[0..1] default: relevance
, options: relevance
,release_date
,release_date_asc
,first_letter
,title
queries
[0..4] default: search
, options: search
,counts
,departments
,featured
aggField
: [0..1] default : _type
; the field that will be used to group on by the count
query
latest
[0..1], options: [true|false], defaults: false filters both search and counts to include only the latest version where description.latestRelease: true
withFirstLetter
[0..1], options: a..Z and is restricted to search
queries will only return results where the title starts with the letter ?
uriPrefix
[0..1], prefix filter on the URI.
topic
[0..1] topic filter , matches exact Topic
topicWildcard
[0..1] topic filter , matches Topics using Wildcard pattern matching
highlight
[0..1], options: [true|false], defaults: true, determines whether to include highlighting on the SEARCH
results
upcoming
[0..1], options: [true|false], defaults: true, determines whether items in the SEARCH
that are not published and not cancelled OR are published and are not due
published
[0..1], options: [true|false], defaults: true, determines whether items in the SEARCH
that are published and not cancelled OR are cancelled and are due
timeseries/{cdid}
Remember to update the README and CHANGELOG files.
Configuration
An overview of the configuration options available, either as a table of
environment variables, or with a link to a configuration guide.
Environment variable |
Default |
Description |
BIND_ADDR |
:23900 |
The host and port to bind to |
ELASTIC_URL |
"http://localhost:9200" |
Http url of the ElasticSearch server |
Releasing
To package up the API uses make package
Deploying
Export the following variables;
- export
DATA_CENTER
to the nomad datacenter to use.
- export
S3_TAR_FILE
to a S3 location on where a release file can be found.
- export
ELASTIC_SEARCH_URL
to elastic search url.
Then run make nomad
this shall create a nomad plan within the root directory
called dp-search-query.nomad
Contributing
See CONTRIBUTING for details.
License
Copyright © 2016-2017, Office for National Statistics (https://www.ons.gov.uk)
Released under MIT license, see LICENSE for details.