The CMR autocomplete API will provide autocomplete suggestions via a RESTful call to an AWS Lambda.
A secondary implementation will use WebSockets. The WebSocket implementation is a stretch goal.
If the WebSocket implementation is completed, the data format for the responses will share the same response schema as the RESTful implementation.
OpenAPI 3.0
View with https://editor.swagger.io/ or using Docker with
|
/search/autocomplete
Fetch autocomplete suggestions from all available facets
curl -XGET https://.../autocomplete?q=ex |
Example Response
HTTP/1.1 200 OK Content-Type: application/json; charset=UTF-8 CMR-Hits: 4 CMR-Took: 382 { "feed": { "entry": [ { "type": "platform", "value": "EXOS-A", "score": 3.17234 }, { "type": "instrument", "value": "EXRAD", "score": 2.36234 }, { "type": "platform", "value": "EXPLORER-9", "score": 0.15234 }, { "type": "provider", "value": "PURDUE/EXTENSION", "score": 0.12323 } ] } } |
Only return suggestions from the supplied type
curl -XGET https://.../autocomplete?q=ice&type[]=instrument |
HTTP/1.1 200 OK Content-Type: application/json; charset=UTF-8 CMR-Hits: 1 CMR-Took: 440 { "feed": { "entry": [ { "type": "instrument", "value": "ICE AUGER", "score": 0.281 } ] } } |
Multiple types may be specified. The order of types provided may not reflect order returned in results array. Only valid facets will be used, unrecognized terms will not be included in results.
curl -XGET https://.../autocomplete?q=sol&type[]=platform&type[]=instrument |
HTTP/1.1 200 OK Content-Type: application/json; charset=UTF-8 CMR-Hits: 3 CMR-Took: 166 { "feed": { "entry": [ { "type": "platform", "value": "SOLAR-A", "score": 0.28234 }, { "type": "platform", "value": "SOLSAT", "score": 0.281 }, { "type": "instrument", "value": "SOLARIZER", "score": 0.263 } ] } } |
curl -XGET https://.../autocomplete?q=foo |
HTTP/1.1 200 OK Content-Type: application/json; charset=UTF-8 CMR-Hits: 0 CMR-Took: 122 { "feed": { "entry": [] } } |