Neural query enricher processor

The neural_query_enricher search request processor is designed to set a default machine learning (ML) model ID at the index or field level for neural search queries. To learn more about ML models, see Using ML models within OpenSearch and Connecting to remote models.

Request fields

The following table lists all available request fields.

FieldData typeDescription
default_model_idStringThe model ID of the default model for an index. Optional. You must specify at least one default_model_id or neural_field_default_id. If both are provided, neural_field_default_id takes precedence.
neural_field_default_idObjectA map of key-value pairs representing document field names and their associated default model IDs. Optional. You must specify at least one default_model_id or neural_field_default_id. If both are provided, neural_field_default_id takes precedence.
tagStringThe processor’s identifier. Optional.
descriptionStringA description of the processor. Optional.

Example

The following example request creates a search pipeline with a neural_query_enricher search request processor. The processor sets a default model ID at the index level and provides different default model IDs for two specific fields in the index:

  1. PUT /_search/pipeline/default_model_pipeline
  2. {
  3. "request_processors": [
  4. {
  5. "neural_query_enricher" : {
  6. "tag": "tag1",
  7. "description": "Sets the default model ID at index and field levels",
  8. "default_model_id": "u5j0qYoBMtvQlfhaxOsa",
  9. "neural_field_default_id": {
  10. "my_field_1": "uZj0qYoBMtvQlfhaYeud",
  11. "my_field_2": "upj0qYoBMtvQlfhaZOuM"
  12. }
  13. }
  14. }
  15. ]
  16. }

copy