Source engines APIedit

Read the Meta Engines guide to learn more about Meta Engines.

Meta Engines are primarily managed through the Engines API.

Meta Engines have a type property of meta, and support a source_engines property.

Example - Create a Meta Engine with two Source Engines

curl -X POST '<ENTERPRISE_SEARCH_BASE_URL>/api/as/v1/engines' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx' \
-d '{
  "name": "national-parks",
  "type": "meta",
  "source_engines": [
    "eastern-national-parks",
    "western-national-parks"
  ]
}'

Documents will have the following fields to help orient yourself within Meta Engine documents:

{
  // The Scoped Document ID, which is the canonical ID for documents within a Meta Engine
  // context. This is the Engine Name and Document ID joined with a pipe character ("|").
  "id": "eastern-national-parks|park_acadia",
  {
    "_meta": {
      // Source Engine document belongs to
      "engine": "eastern-national-parks",
      // Un-scoped Document ID
      "id": "park_acadia"
    },
  }
}

The _engine field can be used to filter documents by Source Engine.

Example - Filter Meta Engine documents by Source Engine

curl -X POST '<ENTERPRISE_SEARCH_BASE_URL>/api/as/v1/engines/national-parks/search' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer search-soaewu2ye6uc45dr8mcd54v8' \
-d '{
  "query": "",
  "filters": {
    "_engine": ["eastern-national-parks"]
  }
}'

Any other API endpoint within a Meta Engine that requires a Document ID as a parameter will require a Scoped Document ID to be used.

Example - Create a Curation on a Meta Engine using Scoped Document ID

curl -X POST '<ENTERPRISE_SEARCH_BASE_URL>/api/as/v1/engines/national-parks/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "queries": [
    "acadia"
  ],
  "promoted": [
    "eastern-national-parks|park_acadia"
  ]
}'

In addition to the Engines API, the following endpoints can be used with Meta Engines:

Add Source Enginesedit

Add one or more Source Engines by name to a Meta Engine.

POST <ENTERPRISE_SEARCH_BASE_URL>/api/as/v1/engines/{ENGINE_NAME}/source_engines

Example

curl -X POST '<ENTERPRISE_SEARCH_BASE_URL>/api/as/v1/engines/national-parks/source_engines' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxx' \
-d '[
  "central-national-parks"
]'

Example Response

{
  "name": "national-parks",
  "type": "meta",
  "source_engines": [
    "central-national-parks",
    "eastern-national-parks",
    "western-national-parks"
  ]
}

Remove Source Enginesedit

Remove one or more Source Engines by name to a Meta Engine.

DELETE <ENTERPRISE_SEARCH_BASE_URL>/api/as/v1/engines/{ENGINE_NAME}/source_engines

Example

curl -X DELETE '<ENTERPRISE_SEARCH_BASE_URL>/api/as/v1/engines/national-parks/source_engines' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxx' \
-d '[
  "western-national-parks"
]'

Example Response

{
  "name": "national-parks",
  "type": "meta",
  "source_engines": [
    "eastern-national-parks"
  ]
}