Search API precision (beta)

edit

Search API precision (beta)

edit

This functionality is in beta. Beta features are subject to change and are not covered by the support SLA of general release (GA) features. Elastic plans to promote this feature to GA in a future release.

Precision tuning has no effect in queries that contain synonyms.

To use precision tuning with an Elasticsearch based engine, you must define text subfields that conform to Elasticsearch engines precision tuning - text field conventions.

Use the precision parameter of the search API to tune precision and recall for a query. Learn more in Precision tuning (beta).

The value of the precision parameter must be an integer between 1 and 11, inclusive. The range of values represents a sliding scale that manages the inherent tradeoff between precision and recall. Lower values favor recall, while higher values favor precision.

See Precision tuning values for a description of all possible values.

Request template

edit
GET <ENTERPRISE_SEARCH_BASE_URL>/api/as/v1/engines/{ENGINE_NAME}/search

{
  "query": "{STRING}",
  "precision": {INTEGER}
}

Example response (200)

edit
# 200 OK
{
  "meta" : {
    # ...
    "precision" : 3,
    # ...
  },
  "results" : [
    # ...
  ]
}

Example response (400)

edit
# 400 Bad Request
{
  "errors": [
    "Precision must be an integer between 1 and 11"
  ]
}

Example response when no precision tuning is enabled (400)

edit
# 400 Bad Request
{
  "errors": [
    "Precision cannot be changed for this engine, as it does not support precision tuning"
  ]
}