diff --git a/_search-plugins/search-pipelines/collapse-processor.md b/_search-plugins/search-pipelines/collapse-processor.md index a802b48acae..4865a68d6da 100644 --- a/_search-plugins/search-pipelines/collapse-processor.md +++ b/_search-plugins/search-pipelines/collapse-processor.md @@ -3,7 +3,7 @@ layout: default title: Collapse nav_order: 10 has_children: false -parent: Search processors +parent: User-defined search processors grand_parent: Search pipelines --- diff --git a/_search-plugins/search-pipelines/explanation-processor.md b/_search-plugins/search-pipelines/explanation-processor.md index 4714f4a0ca2..37b987840aa 100644 --- a/_search-plugins/search-pipelines/explanation-processor.md +++ b/_search-plugins/search-pipelines/explanation-processor.md @@ -3,7 +3,7 @@ layout: default title: Hybrid score explanation nav_order: 15 has_children: false -parent: Search processors +parent: User-defined search processors grand_parent: Search pipelines --- diff --git a/_search-plugins/search-pipelines/filter-query-processor.md b/_search-plugins/search-pipelines/filter-query-processor.md index a55180f53c7..8eb69e647f7 100644 --- a/_search-plugins/search-pipelines/filter-query-processor.md +++ b/_search-plugins/search-pipelines/filter-query-processor.md @@ -3,7 +3,7 @@ layout: default title: Filter query nav_order: 20 has_children: false -parent: Search processors +parent: User-defined search processors grand_parent: Search pipelines --- diff --git a/_search-plugins/search-pipelines/index.md b/_search-plugins/search-pipelines/index.md index 361b3dd6697..c4b9163ae5c 100644 --- a/_search-plugins/search-pipelines/index.md +++ b/_search-plugins/search-pipelines/index.md @@ -10,27 +10,22 @@ redirect_from: # Search pipelines -You can use _search pipelines_ to build new or reuse existing result rerankers, query rewriters, and other components that operate on queries or results. Search pipelines make it easier for you to process search queries and search results within OpenSearch. Moving some of your application functionality into an OpenSearch search pipeline reduces the overall complexity of your application. As part of a search pipeline, you specify a list of processors that perform modular tasks. You can then easily add or reorder these processors to customize search results for your application. +You can use _search pipelines_ to build new or reuse existing result rerankers, query rewriters, and other components that operate on queries or results. Search pipelines make it easier for you to process search queries and search results within OpenSearch. Moving some of your application functionality into an OpenSearch search pipeline reduces the overall complexity of your application. As part of a search pipeline, you specify a list of search processors that perform modular tasks. You can then easily add or reorder these processors to customize search results for your application. -## Terminology - -The following is a list of search pipeline terminology: - -* [_Search request processor_]({{site.url}}{{site.baseurl}}/search-plugins/search-pipelines/search-processors#search-request-processors): A component that intercepts a search request (the query and the metadata passed in the request), performs an operation with or on the search request, and returns the search request. -* [_Search response processor_]({{site.url}}{{site.baseurl}}/search-plugins/search-pipelines/search-processors#search-response-processors): A component that intercepts a search response and search request (the query, results, and metadata passed in the request), performs an operation with or on the search response, and returns the search response. -* [_Search phase results processor_]({{site.url}}{{site.baseurl}}/search-plugins/search-pipelines/search-processors#search-phase-results-processors): A component that runs between search phases at the coordinating node level. A search phase results processor intercepts the results retrieved from one search phase and transforms them before passing them to the next search phase. -* [_Processor_]({{site.url}}{{site.baseurl}}/search-plugins/search-pipelines/search-processors/): Either a search request processor or a search response processor. -* _Search pipeline_: An ordered list of processors that is integrated into OpenSearch. The pipeline intercepts a query, performs processing on the query, sends it to OpenSearch, intercepts the results, performs processing on the results, and returns them to the calling application, as shown in the following diagram. +When defined, a search pipeline is an ordered list of search processors that is integrated into OpenSearch. The pipeline shown in the following diagram intercepts a query, performs processing on the query, sends it to OpenSearch, intercepts the results, performs processing on the results, and returns them to the calling application. ![Search processor diagram]({{site.url}}{{site.baseurl}}/images/search-pipelines.png) Both request and response processing for the pipeline are performed on the coordinator node, so there is no shard-level processing. {: .note} -## Processors +## Search processors -To learn more about available search processors, see [Search processors]({{site.url}}{{site.baseurl}}/search-plugins/search-pipelines/search-processors/). +Search processors can be classified by **execution phase** (when they run): +- [Search request processors]({{site.url}}{{site.baseurl}}/search-plugins/search-pipelines/search-processors#search-request-processors): A _search request processor_ intercepts a search request (the query and the metadata passed in the request), performs an operation with or on the search request, and submits the search request to the index. +- [Search response processors]({{site.url}}{{site.baseurl}}/search-plugins/search-pipelines/search-processors#search-response-processors): A _search response processor_ intercepts a search response and search request (the query, results, and metadata passed in the request), performs an operation with or on the search response, and returns the search response. +- [Search phase results processors]({{site.url}}{{site.baseurl}}/search-plugins/search-pipelines/search-processors#search-phase-results-processors): A _search phase results processor_ runs between search phases at the coordinating node level. It intercepts the results retrieved from one search phase and transforms them before passing them to the next search phase. ## Example @@ -77,6 +72,12 @@ Alternatively, you can use a temporary pipeline with a request or set a default To learn about retrieving details for an existing search pipeline, see [Retrieving search pipelines]({{site.url}}{{site.baseurl}}/search-plugins/search-pipelines/retrieving-search-pipeline/). +## Manual and automatic processor creation + +Search processors can be created manually or automatically: + +- [User-defined processors]({{site.url}}{{site.baseurl}}/search-plugins/search-pipelines/search-processors): Processors configured manually in search pipelines, like in the preceding [example](#example). +- [System-generated processors]({{site.url}}{{site.baseurl}}/search-plugins/search-pipelines/system-generated-search-processors/): Processors automatically created by OpenSearch based on search request parameters. ## Search pipeline metrics diff --git a/_search-plugins/search-pipelines/ml-inference-search-request.md b/_search-plugins/search-pipelines/ml-inference-search-request.md index 8eddb0400b8..2818d5378ba 100644 --- a/_search-plugins/search-pipelines/ml-inference-search-request.md +++ b/_search-plugins/search-pipelines/ml-inference-search-request.md @@ -3,7 +3,7 @@ layout: default title: ML inference (request) nav_order: 30 has_children: false -parent: Search processors +parent: User-defined search processors grand_parent: Search pipelines --- diff --git a/_search-plugins/search-pipelines/ml-inference-search-response.md b/_search-plugins/search-pipelines/ml-inference-search-response.md index 5f8b1034afd..9ea5b494cbb 100644 --- a/_search-plugins/search-pipelines/ml-inference-search-response.md +++ b/_search-plugins/search-pipelines/ml-inference-search-response.md @@ -3,7 +3,7 @@ layout: default title: ML inference (response) nav_order: 40 has_children: false -parent: Search processors +parent: User-defined search processors grand_parent: Search pipelines --- diff --git a/_search-plugins/search-pipelines/neural-query-enricher.md b/_search-plugins/search-pipelines/neural-query-enricher.md index a237f8841d7..684d5ba1ea8 100644 --- a/_search-plugins/search-pipelines/neural-query-enricher.md +++ b/_search-plugins/search-pipelines/neural-query-enricher.md @@ -3,7 +3,7 @@ layout: default title: Neural query enricher nav_order: 50 has_children: false -parent: Search processors +parent: User-defined search processors grand_parent: Search pipelines --- diff --git a/_search-plugins/search-pipelines/neural-sparse-query-two-phase-processor.md b/_search-plugins/search-pipelines/neural-sparse-query-two-phase-processor.md index 536d1670837..3a4c787869f 100644 --- a/_search-plugins/search-pipelines/neural-sparse-query-two-phase-processor.md +++ b/_search-plugins/search-pipelines/neural-sparse-query-two-phase-processor.md @@ -2,7 +2,7 @@ layout: default title: Neural sparse query two-phase nav_order: 60 -parent: Search processors +parent: User-defined search processors grand_parent: Search pipelines --- diff --git a/_search-plugins/search-pipelines/normalization-processor.md b/_search-plugins/search-pipelines/normalization-processor.md index 89f6157f4d9..5e4c2f34633 100644 --- a/_search-plugins/search-pipelines/normalization-processor.md +++ b/_search-plugins/search-pipelines/normalization-processor.md @@ -3,7 +3,7 @@ layout: default title: Normalization nav_order: 70 has_children: false -parent: Search processors +parent: User-defined search processors grand_parent: Search pipelines --- diff --git a/_search-plugins/search-pipelines/oversample-processor.md b/_search-plugins/search-pipelines/oversample-processor.md index e881d5f32ce..9c82e3253f4 100644 --- a/_search-plugins/search-pipelines/oversample-processor.md +++ b/_search-plugins/search-pipelines/oversample-processor.md @@ -3,7 +3,7 @@ layout: default title: Oversample nav_order: 80 has_children: false -parent: Search processors +parent: User-defined search processors grand_parent: Search pipelines --- diff --git a/_search-plugins/search-pipelines/personalize-search-ranking.md b/_search-plugins/search-pipelines/personalize-search-ranking.md index 630e249b7fc..2f97e7f3512 100644 --- a/_search-plugins/search-pipelines/personalize-search-ranking.md +++ b/_search-plugins/search-pipelines/personalize-search-ranking.md @@ -3,7 +3,7 @@ layout: default title: Personalize search ranking nav_order: 85 has_children: false -parent: Search processors +parent: User-defined search processors grand_parent: Search pipelines --- diff --git a/_search-plugins/search-pipelines/rag-processor.md b/_search-plugins/search-pipelines/rag-processor.md index f7ed1795248..b4c138d4c08 100644 --- a/_search-plugins/search-pipelines/rag-processor.md +++ b/_search-plugins/search-pipelines/rag-processor.md @@ -3,7 +3,7 @@ layout: default title: Retrieval-augmented generation nav_order: 115 has_children: false -parent: Search processors +parent: User-defined search processors grand_parent: Search pipelines --- diff --git a/_search-plugins/search-pipelines/rename-field-processor.md b/_search-plugins/search-pipelines/rename-field-processor.md index 4715a6308a7..dbba700b1ef 100644 --- a/_search-plugins/search-pipelines/rename-field-processor.md +++ b/_search-plugins/search-pipelines/rename-field-processor.md @@ -3,7 +3,7 @@ layout: default title: Rename field nav_order: 100 has_children: false -parent: Search processors +parent: User-defined search processors grand_parent: Search pipelines --- diff --git a/_search-plugins/search-pipelines/rerank-processor.md b/_search-plugins/search-pipelines/rerank-processor.md index 11691eff957..3964cbca3e2 100644 --- a/_search-plugins/search-pipelines/rerank-processor.md +++ b/_search-plugins/search-pipelines/rerank-processor.md @@ -3,7 +3,7 @@ layout: default title: Rerank nav_order: 110 has_children: false -parent: Search processors +parent: User-defined search processors grand_parent: Search pipelines --- diff --git a/_search-plugins/search-pipelines/score-ranker-processor.md b/_search-plugins/search-pipelines/score-ranker-processor.md index 1bc3fca1910..2f7538170b6 100644 --- a/_search-plugins/search-pipelines/score-ranker-processor.md +++ b/_search-plugins/search-pipelines/score-ranker-processor.md @@ -2,7 +2,7 @@ layout: default title: Score ranker has_children: false -parent: Search processors +parent: User-defined search processors grand_parent: Search pipelines nav_order: 117 --- diff --git a/_search-plugins/search-pipelines/script-processor.md b/_search-plugins/search-pipelines/script-processor.md index d927348d335..20d65635b9b 100644 --- a/_search-plugins/search-pipelines/script-processor.md +++ b/_search-plugins/search-pipelines/script-processor.md @@ -3,7 +3,7 @@ layout: default title: Script nav_order: 120 has_children: false -parent: Search processors +parent: User-defined search processors grand_parent: Search pipelines --- diff --git a/_search-plugins/search-pipelines/search-pipeline-metrics.md b/_search-plugins/search-pipelines/search-pipeline-metrics.md index 4c43a73b5bd..9d72ecc829e 100644 --- a/_search-plugins/search-pipelines/search-pipeline-metrics.md +++ b/_search-plugins/search-pipelines/search-pipeline-metrics.md @@ -1,7 +1,7 @@ --- layout: default title: Search pipeline metrics -nav_order: 50 +nav_order: 60 has_children: false parent: Search pipelines --- diff --git a/_search-plugins/search-pipelines/search-processors.md b/_search-plugins/search-pipelines/search-processors.md index de4f97de1f6..dca265dc994 100644 --- a/_search-plugins/search-pipelines/search-processors.md +++ b/_search-plugins/search-pipelines/search-processors.md @@ -1,22 +1,20 @@ --- layout: default -title: Search processors +title: User-defined search processors nav_order: 40 has_children: true parent: Search pipelines --- -# Search processors +# User-defined search processors -Search processors can be of the following types: +**User-defined search processors** are processors that you manually configure in search pipelines to customize search behavior. You define these processors in your pipeline configuration and control their parameters, execution order, and conditions. -- [Search request processors](#search-request-processors) -- [Search response processors](#search-response-processors) -- [Search phase results processors](#search-phase-results-processors) +The following sections list all user-defined search processors available in OpenSearch. OpenSearch can also create processors automatically based on search request parameters. For more information, see [System-generated search processors]({{site.url}}{{site.baseurl}}/search-plugins/search-pipelines/system-generated-search-processors/). ## Search request processors -A search request processor intercepts a search request (the query and the metadata passed in the request), performs an operation with or on the search request, and submits the search request to the index. +A _search request processor_ intercepts a search request (the query and the metadata passed in the request), performs an operation with or on the search request, and submits the search request to the index. The following table lists all supported search request processors. @@ -31,7 +29,7 @@ Processor | Description | Earliest available version ## Search response processors -A search response processor intercepts a search response and search request (the query, results, and metadata passed in the request), performs an operation with or on the search response, and returns the search response. +A _search response processor_ intercepts a search response and search request (the query, results, and metadata passed in the request), performs an operation with or on the search response, and returns the search response. The following table lists all supported search response processors. @@ -48,10 +46,9 @@ Processor | Description | Earliest available version [`split`]({{site.url}}{{site.baseurl}}/search-plugins/search-pipelines/split-processor/)| Splits a string field into an array of substrings based on a specified delimiter. | 2.17 [`truncate_hits`]({{site.url}}{{site.baseurl}}/search-plugins/search-pipelines/truncate-hits-processor/)| Discards search hits after a specified target count is reached. Can undo the effect of the `oversample` request processor. | 2.12 - ## Search phase results processors -A search phase results processor runs between search phases at the coordinating node level. It intercepts the results retrieved from one search phase and transforms them before passing them to the next search phase. +A _search phase results processor_ runs between search phases at the coordinating node level. It intercepts the results retrieved from one search phase and transforms them before passing them to the next search phase. The following table lists all supported search phase results processors. diff --git a/_search-plugins/search-pipelines/sort-processor.md b/_search-plugins/search-pipelines/sort-processor.md index 1b4a28d2a9e..1ec5e80dac4 100644 --- a/_search-plugins/search-pipelines/sort-processor.md +++ b/_search-plugins/search-pipelines/sort-processor.md @@ -3,7 +3,7 @@ layout: default title: Sort nav_order: 130 has_children: false -parent: Search processors +parent: User-defined search processors grand_parent: Search pipelines --- diff --git a/_search-plugins/search-pipelines/split-processor.md b/_search-plugins/search-pipelines/split-processor.md index 0ffcc6fea99..77e8934961e 100644 --- a/_search-plugins/search-pipelines/split-processor.md +++ b/_search-plugins/search-pipelines/split-processor.md @@ -3,7 +3,7 @@ layout: default title: Split nav_order: 140 has_children: false -parent: Search processors +parent: User-defined search processors grand_parent: Search pipelines --- diff --git a/_search-plugins/search-pipelines/system-generated-search-processors.md b/_search-plugins/search-pipelines/system-generated-search-processors.md new file mode 100644 index 00000000000..e78a2608784 --- /dev/null +++ b/_search-plugins/search-pipelines/system-generated-search-processors.md @@ -0,0 +1,66 @@ +--- +layout: default +title: System-generated search processors +nav_order: 50 +has_children: false +parent: Search pipelines +--- + +# System-generated search processors +**Introduced 3.3** +{: .label .label-purple } + +System-generated search processors are processors that OpenSearch creates automatically based on the search request. Unlike [user-defined processors]({{site.url}}{{site.baseurl}}/search-plugins/search-pipelines/search-processors/) that you manually configure in pipelines, system-generated processors are triggered automatically when certain features are used, eliminating the need for manual processor configuration. + +## Enabling system-generated search processors + +To enable system-generated search processor creation, set the `cluster.search.enabled_system_generated_factories` cluster setting to `*` (all factories) or explicitly list the factories you want to enable. The following example enables `mmr_over_sample_factory` and `mmr_rerank_factory`: + +```json +PUT _cluster/settings +{ + "persistent": { + "cluster.search.enabled_system_generated_factories": [ + "mmr_over_sample_factory", + "mmr_rerank_factory" + ] + } +} +``` +{% include copy-curl.html %} + +## Processor types + +OpenSearch supports the following types of system-generated processors: + +* [Search request processors](#system-generated-search-request-processors) +* [Search response processors](#system-generated-search-response-processors) + +Each system-generated processor runs at a fixed execution stage, either before or after user-defined processors of the same type. +{: .note} + +### System-generated search request processors + +The following table lists the available system-generated search request processors. + +| Processor name | Processor factory name | Execution stage | Trigger condition | Description | +| ----------------- | ------------------------- | ------------------- | ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | +| `mmr_over_sample` | `mmr_over_sample_factory` | Runs after any user-defined request processors. | Triggered when a search request includes the `mmr` parameter in the `ext` object. See [Vector search with MMR reranking]({{site.url}}{{site.baseurl}}/vector-search/specialized-operations/vector-search-mmr/). | Adjusts the query size and `k` value of the `knn` or `neural` query to oversample candidates for maximal marginal relevance (MMR) reranking. | + +### System-generated search response processors + +The following table lists the available system-generated search response processors. + +| Processor name | Processor factory name | Execution stage | Trigger condition | Description | +| -------------- | ---------------------- | ------------------ | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `mmr_rerank` | `mmr_rerank_factory` | Runs before any user-defined response processors. | Triggered when a search request includes the `mmr` parameter in the `ext` object. See [Vector search with MMR reranking]({{site.url}}{{site.baseurl}}/vector-search/specialized-operations/vector-search-mmr/). | Reranks the oversampled results using MMR and reduces them to the original query size. | + +## Limitations + +The following limitations apply to system-generated processors: + +- OpenSearch supports only **one system-generated processor per processor type and execution stage** for a given search request. Since each processor type (request and response) can run at two execution stages (before or after user-defined processors), a single search request can include multiple system-generated processors, as long as they are of different types or run at different execution stages. This limitation ensures deterministic execution order and predictable behavior. + +## Related pages + +- [Vector search with MMR reranking]({{site.url}}{{site.baseurl}}/vector-search/specialized-operations/vector-search-mmr/) \ No newline at end of file diff --git a/_search-plugins/search-pipelines/truncate-hits-processor.md b/_search-plugins/search-pipelines/truncate-hits-processor.md index 12426f38900..927650c9671 100644 --- a/_search-plugins/search-pipelines/truncate-hits-processor.md +++ b/_search-plugins/search-pipelines/truncate-hits-processor.md @@ -3,7 +3,7 @@ layout: default title: Truncate hits nav_order: 150 has_children: false -parent: Search processors +parent: User-defined search processors grand_parent: Search pipelines --- diff --git a/_vector-search/specialized-operations/index.md b/_vector-search/specialized-operations/index.md index 4a97327fd4c..a901dd0b212 100644 --- a/_vector-search/specialized-operations/index.md +++ b/_vector-search/specialized-operations/index.md @@ -13,6 +13,9 @@ cards: - heading: "Radial search" description: "Search all points in a vector space that reside within a specified maximum distance or minimum score threshold from a query point" link: "/vector-search/specialized-operations/radial-search-knn/" + - heading: "Vector search with MMR reranking" + description: "Improve vector search results by automatically reranking for both relevance and diversity using maximal marginal relevance (MMR)" + link: "/vector-search/specialized-operations/vector-search-mmr/" --- # Specialized vector search diff --git a/_vector-search/specialized-operations/vector-search-mmr.md b/_vector-search/specialized-operations/vector-search-mmr.md new file mode 100644 index 00000000000..6c422553feb --- /dev/null +++ b/_vector-search/specialized-operations/vector-search-mmr.md @@ -0,0 +1,129 @@ +--- +layout: default +title: Vector search with MMR reranking +nav_order: 60 +parent: Specialized vector search +has_children: false +has_math: true +--- + +# Vector search with MMR reranking +**Introduced 3.3** +{: .label .label-purple } + +The maximal marginal relevance (MMR) search helps balance relevance and diversity in search results. Instead of returning only the most similar documents, MMR selects results that are both relevant to the query and different from each other. This improves the coverage of the result set and reduces redundancy, which is especially useful in vector search scenarios. + +MMR reranking balances two competing objectives: + + - Relevance: How well a document matches the query. + + - Diversity: How different a document is from the documents already selected. + +The algorithm computes a score for each candidate document using the following formula: + +$$MMR = (1 − \lambda) \times \text{relevance_score} - \lambda \times max(\text{similarity_with_selected_docs})$$, + +where: + + - $$\lambda$$ is the diversity parameter (closer to 1 means higher diversity). + + - $$\text{relevance_score}$$ measures similarity between the query vector and the candidate document vector. + + - $$\text{similarity_with_selected_docs}$$ measures similarity between the candidate and already selected documents. + +By adjusting $$\lambda$$, you can control the trade-off between highly relevant results and more diverse coverage in the result set. + +# Prerequisites + +To use MMR, you must enable [system-generated search processor factories]({{site.url}}{{site.baseurl}}/search-plugins/search-pipelines/system-generated-search-processors/). Set the `cluster.search.enabled_system_generated_factories` setting (by default, an empty list) to `*` (all factories) or explicitly include the required factories: + +```json +PUT _cluster/settings +{ + "persistent": { + "cluster.search.enabled_system_generated_factories": [ + "mmr_over_sample_factory", + "mmr_rerank_factory" + ] + } +} +``` +{% include copy-curl.html %} + +# Parameters + +The `mmr` object is provided in the `ext` object of the Search API request body and supports the following parameters. + +| Parameter | Data type | Required/Optional | Description | +| ------------------------- | --------- | ----------------------------------------- |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `diversity` | Float | Optional | Controls the weight of diversity ($$\lambda$$) in the reranking process. Valid values range from `0` to `1`, inclusive. A value of `1` prioritizes maximum diversity; `0` disables diversity. Default is `0.5`. | +| `candidates` | Integer | Optional | The number of candidate documents to retrieve before applying MMR reranking. Default is `3 * size`, where `size` is the query's `size` parameter (the requested number of results to return). | +| `vector_field_path` | String | Optional (required for remote indexes) | The path to the vector field used for MMR reranking. If not provided, OpenSearch resolves it automatically from the search request. | +| `vector_field_data_type` | String | Optional (required for remote indexes) | The data type of the vector field. Used to parse the field and calculate similarity. If not provided, OpenSearch resolves it from the index mapping. | +| `vector_field_space_type` | String | Optional (required for remote indexes) | Used to determine the similarity function for the vector field, such as cosine similarity or Euclidean distance. If not provided, OpenSearch resolves it from the index mapping. | + + +# Example request + +The following example shows how to use the `mmr` parameter in a `knn` query: + +```json +POST /my-index/_search +{ + "query": { + "knn": { + "my_vector_field": { + "vector": [0.12, 0.54, 0.91], + "k": 10 + } + } + }, + "ext": { + "mmr": { + "diversity": 0.7 + } + } +} +``` +{% include copy-curl.html %} + +The following example shows how to use the `mmr` parameter in a `neural` query: + +```json +POST /my-index/_search +{ + "query": { + "neural": { + "my_vector_field": { + "query_text": "query text", + "model_id": "" + } + } + }, + "ext": { + "mmr": { + "diversity": 0.6, + "candidates": 50, + "vector_field_path": "my_vector_field", + "vector_field_data_type": "float", + "vector_field_space_type": "l2" + } + } +} +``` +{% include copy-curl.html %} + +When querying multiple indexes, all vector fields must have matching data types and space types. These settings determine the similarity function used for document comparisons. +{: .note} + +# Limitations + +The following limitations apply to vector search with MMR reranking: + +- **Supported query types**: MMR supports only a `knn` or `neural` query as the top-level query in a search request. If a `knn` or `neural` query is nested inside another query type (such as a `bool` query or `hybrid` query), MMR is not supported. + +- **Remote index requirements**: When querying remote indexes, you must explicitly provide vector field information (`vector_field_path`, `vector_field_data_type`, and `vector_field_space_type`). Unlike a local index for which OpenSearch can automatically resolve this metadata from the index mapping, the system cannot reliably fetch this information from the remote cluster. Providing these details ensures correct parsing of the vector data and accurate similarity calculations. + +## Related pages + +- [System-generated search processors]({{site.url}}{{site.baseurl}}/search-plugins/search-pipelines/system-generated-search-processors/) \ No newline at end of file