Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Autocomplete API

Jira
serverEarthdata Ticketing System
serverId9a2ac141-7181-31f1-a247-ccbc66e20158
keyCMR-6157

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.


Table of Contents
stylenone

OpenAPI 3.0

View file
nameopenapi.yaml
height250

Info

View with https://editor.swagger.io/ or using Docker with

Code Block
docker container run --rm -p 80:8080 swaggerapi/swagger-editor



/search/autocomplete

Query with a term

Fetch autocomplete suggestions from all available facets

Code Block
curl -XGET https://.../autocomplete?q=ex

Example Response

Code Block
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
      }
    ]
  }
}

Query with type filter

Only return suggestions from the supplied type

Code Block
curl -XGET https://.../autocomplete?q=ice&type[]=instrument
Example Response


Code Block
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
      }
    ]
  }
}

Query with multiple types

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.

Code Block
curl -XGET https://.../autocomplete?q=sol&type[]=platform&type[]=instrument
Example Response


Code Block
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
      }
    ]
  }
}

Query with no results

Code Block
curl -XGET https://.../autocomplete?q=foo
Example Response


Code Block
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
CMR-Hits: 0
CMR-Took: 122

{
  "feed": {
    "entry": []
  }
}