Skip to content
Merged
Changes from 4 commits
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
25 changes: 25 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,31 @@ PUT test-index
}
```

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

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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- [Match query](/reference/query-languages/query-dsl/query-dsl-match-query.md) - The recommended method for querying `semantic_text` fields.
- [Match query](/reference/query-languages/query-dsl/query-dsl-match-query.md): The recommended method for querying `semantic_text` fields.

You can perform match queries in query DSL or ESQL, so we should use tabs here (like we do in this doc) and mention https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/search-functions#esql-match

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this should be included in the query examples section (the one we link to from here), right?
cc @charlotte-hoblik

Copy link
Contributor

Choose a reason for hiding this comment

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

right but if you're linking to query DSL here, then you should link to ESQL too for symmetry, but it doesn't necessarily have to be tabs if that's too heavy-handed

Copy link
Contributor

Choose a reason for hiding this comment

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

You could just do something like:

  • Match query: The recommended method for querying semantic_text fields. You can use Query DSL or ES|QL syntax.

<!--
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.
-->


## 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