Wrapper endpoint for all search related pipelines, each endpoint will call a pipeline under the hood, the advantage of this approach, is the possibility of documenting the input and output of the pipeline, as well as the possibility of hot updated 

Execute Get Search

GAIA API endpoint, working as a wrapper for a specific pipeline, which will execute with the provided query params. The main goal of this endpoint is to serve as an example of how static, well-defined endpoints can be created with a flexible and configurable backend.

The starting body provided by Swagger are almost the minimum (the minimum being just q), for more options please check the schema.

Remove this endpoint or update the pipeline it is using; this endpoint is not intended for production.


Query Parameters

ParameterTypeDescriptionRequired
qstringString query to execute in the search engineNo
sizeintegerNumber of hits to return per requestNo
fromintegerStart position for retrieving hitsNo
pageintegerStart page for retrieving hits. Minimum page is 1. Not applicable when from is being usedNo
fetch_fieldsarrayList of fields to return in the response based on field valuesNo
scrollstringPeriod to retain the search context for scrollingNo
default_operatorstringThe default operator for query string query: AND or ORNo
exclude_fieldsarrayList of fields to exclude in the response based on field values

No

debug_searchstringAdd/Remove "search" results from final response. ('True' or 'False')

No

allow_empty_querybooleanAllow empty queries to be searched (e.g. " ", "*", "*.*")

No

Example

GET /es/api/v1/search/?q=query&size=10&from=0&fetch_fields=field1,field2&scroll=1m

Response

Successful Response [200]

{
  "aggregations": [
    ...
  ],
  "hits": [
    {
      "body": [
        ...
      ],
      "header": [],
      "title": {...},
      "sub_title": {...},
      "id": "unique_id"
    }
  ],
  "total": 10000
}

Validation Error [422]

{
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Execute Post Search

GAIA API endpoint, working as a wrapper for a specific pipeline, which will execute with the provided body. The main goal of this endpoint is to serve as an example of how static, well-defined endpoints can be created with a flexible and configurable backend.

The starting body provided by Swagger are almost the minimum (the minimum being just q), for more options please check the schema.

Remove this endpoint or update the pipeline it is using; this endpoint is not intended for production.

Parameters

NameTypeDescriptionRequired
qstringString query to execute in the search engineNo
sizeintegerNumber of hits to return per requestNo
fromintegerStart position for retrieving hitsNo
pageintegerStart page for retrieving hits. Minimum page is 1. Not applicable when from is being usedNo
fetch_fieldsarrayList of fields to return in the response based on field valuesNo
scrollstringPeriod to retain the search context for scrollingNo
default_operatorstringThe default operator for query string query: AND or ORNo
exclude_fieldsarrayList of fields to exclude in the response based on field valuesNo
debug_searchstringAdd/Remove "search" results from final response. ('True' or 'False')No
allow_empty_querybooleanAllow empty queries to be searched (e.g. " ", "*", "*.*")No

Example

POST /es/api/v1/search/

{
  "q": "query",
  "size": 10,
  "from": 0,
  "fetch_fields": ["field1", "field2"],
  "scroll": "1m"
}

Response

Successful Response [200]

{
  "aggregations": [
    ...
  ],
  "hits": [
    {
      "body": [
        ...
      ],
      "header": [],
      "title": {...},
      "sub_title": {...},
      "id": "unique_id"
    }
  ],
  "total": 10000
}

Validation Error [422]

{
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Execute Post Search Metadata

GAIA API endpoint, working as a wrapper for a specific pipeline "search_metadata", which will execute with the provided body. This endpoint will fetch the specific document id for the metadata specified in the pipeline

The starting body provided by Swagger are almost the minimum (the minimum being just q), for more options please check the schema.

Remove this endpoint or update the pipeline it is using; this endpoint is not intended for production.

Parameters

NameTypeDescription
doc_idstringDocument ID


Example

GET /es/api/v1/search/metadata/{doc_id}

Response

Successful Response [200]

{
    "body": [
        ...
    ],
    "header": [],
    "title": {...},
    "sub_title": {...},
    "id": "unique_id"
}

Validation Error [422]

{
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}