Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions docs/reference/elasticsearch/mapping-reference/semantic-text.md
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,21 @@ PUT test-index
}
```

## Querying `semantic_text` fields [querying-semantic-text-fields]

Querying `semantic_text` fields enables semantic search by matching on meaning rather than just keywords. It’s useful for natural language search, intent-aware retrieval, and cases where keyword matching alone isn’t sufficient.

You can query `semantic_text` fields using the following query types:

- [Match query](/reference/query-languages/query-dsl/query-dsl-match-query.md) - The recommended method for querying `semantic_text` fields. Refer to examples of match queries on `semantic_text` fields.

- [kNN query](/reference/query-languages/query-dsl/query-dsl-knn-query.md) - Finds the nearest vectors to a query vector using a similarity metric, mainly for advanced or combined search use cases. Refer to examples of kNN queries on `semantic_text` fields.

- [Sparse vector query](/reference/query-languages/query-dsl/query-dsl-sparse-vector-query.md) - Executes searches using sparse vectors generated by a sparse retrieval model. Refer to examples of sparse vector queries on `semantic_text` fields.

- [Semantic query](/reference/query-languages/query-dsl/query-dsl-semantic-query.md) - A legacy option that was introduced earlier and is no longer recommended, but it remains supported for existing implementations. Refer to examples of semantic queries on `semantic_text` fields.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the semantic query is GA and still supported, do we really want to use this language?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to use this exact verbiage, but if we have strong opinions and we don't think folks should use semantic queries in new implementations, then we should be quite clear about that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe @serenachou raised the original issue in slack, (which I had misremembered as coming from you Kathleen 😄) :

semantic_text now supports multiple query types (match, knn, sparse_vector) that provide more flexibility and customization options. This leads to confusion and has led to feature requests for functionality that already exists in other query types.

So there's nothing wrong with being clear in our recommendations, while still stating that semantic queries remain supported

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.



## Troubleshooting semantic_text fields [troubleshooting-semantic-text-fields]

If you want to verify that your embeddings look correct, you can view the
Expand Down
Loading