diff --git a/docs/reference/mapping/types/semantic-text.asciidoc b/docs/reference/mapping/types/semantic-text.asciidoc index 96dc402e10c60..4514c8b6756a8 100644 --- a/docs/reference/mapping/types/semantic-text.asciidoc +++ b/docs/reference/mapping/types/semantic-text.asciidoc @@ -13,6 +13,7 @@ Long passages are <> to smaller secti The `semantic_text` field type specifies an inference endpoint identifier that will be used to generate embeddings. You can create the inference endpoint by using the <>. This field type and the <> type make it simpler to perform semantic search on your data. +The `semantic_text` field type may also be queried with <>, <> or <> queries. If you don’t specify an inference endpoint, the `inference_id` field defaults to `.elser-2-elasticsearch`, a preconfigured endpoint for the elasticsearch service. diff --git a/docs/reference/query-dsl/knn-query.asciidoc b/docs/reference/query-dsl/knn-query.asciidoc index e42bd78d9f14a..29ccadfa70a03 100644 --- a/docs/reference/query-dsl/knn-query.asciidoc +++ b/docs/reference/query-dsl/knn-query.asciidoc @@ -8,7 +8,8 @@ Finds the _k_ nearest vectors to a query vector, as measured by a similarity metric. _knn_ query finds nearest vectors through approximate search on indexed dense_vectors. The preferred way to do approximate kNN search is through the <> of a search request. _knn_ query is reserved for -expert cases, where there is a need to combine this query with other queries. +expert cases, where there is a need to combine this query with other queries, or +perform a kNN search against a <> field. [[knn-query-ex-request]] ==== Example request @@ -77,7 +78,8 @@ POST my-image-index/_search + -- (Required, string) The name of the vector field to search against. Must be a -<>. +<>, or a +<> with a compatible dense vector inference model. -- `query_vector`:: @@ -93,6 +95,7 @@ Either this or `query_vector_builder` must be provided. -- (Optional, object) Query vector builder. include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=knn-query-vector-builder] +If all queried fields are of type <>, the inference ID associated with the `semantic_text` field may be inferred. -- `k`:: diff --git a/docs/reference/query-dsl/match-query.asciidoc b/docs/reference/query-dsl/match-query.asciidoc index eb840508aba39..67300ffca2d26 100644 --- a/docs/reference/query-dsl/match-query.asciidoc +++ b/docs/reference/query-dsl/match-query.asciidoc @@ -10,6 +10,10 @@ provided text is analyzed before matching. The `match` query is the standard query for performing a full-text search, including options for fuzzy matching. +`Match` will also work against <> fields, +however when performing `match` queries against `semantic_text` fields options +that specifically target lexical search such as `fuzziness` or `analyzer` will be ignored. + [[match-query-ex-request]] ==== Example request @@ -296,4 +300,3 @@ The example above creates a boolean query: that matches documents with the term `ny` or the conjunction `new AND york`. By default the parameter `auto_generate_synonyms_phrase_query` is set to `true`. - diff --git a/docs/reference/query-dsl/sparse-vector-query.asciidoc b/docs/reference/query-dsl/sparse-vector-query.asciidoc index 399cf29d4dd12..d46d649079d70 100644 --- a/docs/reference/query-dsl/sparse-vector-query.asciidoc +++ b/docs/reference/query-dsl/sparse-vector-query.asciidoc @@ -11,7 +11,8 @@ This can be achieved with one of two strategies: - Using an {nlp} model to convert query text into a list of token-weight pairs - Sending in precalculated token-weight pairs as query vectors -These token-weight pairs are then used in a query against a <>. +These token-weight pairs are then used in a query against a <> +or a <> field with a compatible sparse inference model. At query time, query vectors are calculated using the same inference model that was used to create the tokens. When querying, these query vectors are ORed together with their respective weights, which means scoring is effectively a <> calculation between stored dimensions and query dimensions. @@ -65,6 +66,7 @@ GET _search It must be the same inference ID that was used to create the tokens from the input text. Only one of `inference_id` and `query_vector` is allowed. If `inference_id` is specified, `query` must also be specified. +If all queried fields are of type <>, the inference ID associated with the `semantic_text` field will be inferred. `query`:: (Optional, string) The query text you want to use for search. @@ -291,5 +293,3 @@ GET my-index/_search //TEST[skip: Requires inference] NOTE: When performing <>, inference is performed on the local cluster. - -