-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Adds "Querying semantic_text fields" section #136076
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🔍 Preview links for changed docs |
ℹ️ Important: Docs version tagging👋 Thanks for updating the docs! Just a friendly reminder that our docs are now cumulative. This means all 9.x versions are documented on the same page and published off of the main branch, instead of creating separate pages for each minor version. We use applies_to tags to mark version-specific features and changes. Expand for a quick overviewWhen to use applies_to tags:✅ At the page level to indicate which products/deployments the content applies to (mandatory) What NOT to do:❌ Don't remove or replace information that applies to an older version 🤔 Need help?
|
Pinging @elastic/core-docs (Team:Docs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left couple options for how we might proceed here, as the original assumed scope of a standalone page has shrunk quite a bit.
docs/reference/elasticsearch/mapping-reference/semantic-text.md
Outdated
Show resolved
Hide resolved
docs/reference/elasticsearch/mapping-reference/semantic-text.md
Outdated
Show resolved
Hide resolved
docs/reference/elasticsearch/mapping-reference/semantic-text.md
Outdated
Show resolved
Hide resolved
|
||
- [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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kosabogi @charlotte-hoblik we should add a note to https://www.elastic.co/docs/reference/query-languages/query-dsl/query-dsl-semantic-query to reiterate this point
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few more little things, thanks for iterating :)
- [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. | ||
- [Match query](/reference/query-languages/query-dsl/query-dsl-match-query.md) - The recommended method for querying `semantic_text` fields. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- [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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs/reference/elasticsearch/mapping-reference/semantic-text.md
Outdated
Show resolved
Hide resolved
docs/reference/elasticsearch/mapping-reference/semantic-text.md
Outdated
Show resolved
Hide resolved
docs/reference/elasticsearch/mapping-reference/semantic-text.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Liam Thompson <[email protected]>
Co-authored-by: Liam Thompson <[email protected]>
Co-authored-by: Liam Thompson <[email protected]>
Co-authored-by: Liam Thompson <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kosabogi!
As a last action on this PR, I had one other suggestion in there to add a note to the semantic query page that mirrors this verbiage:
We don't recommend this legacy query type for new projects, because the alternatives in this list enable more flexibility and customization. The semantic query remains available to support existing implementations.
Ignore if the plan was to add that in another PR :)
@leemthompo I added the note in this PR, could you take a last look please? Thank you! :) |
🚢 |
* Adds Querying semantic_text fields section * Update docs/reference/elasticsearch/mapping-reference/semantic-text.md Co-authored-by: Liam Thompson <[email protected]> * Comment out links temporarily * Update docs/reference/elasticsearch/mapping-reference/semantic-text.md Co-authored-by: Liam Thompson <[email protected]> * Update docs/reference/elasticsearch/mapping-reference/semantic-text.md Co-authored-by: Liam Thompson <[email protected]> * Update docs/reference/elasticsearch/mapping-reference/semantic-text.md Co-authored-by: Liam Thompson <[email protected]> * Update docs/reference/elasticsearch/mapping-reference/semantic-text.md Co-authored-by: Liam Thompson <[email protected]> * Adds ESQL link to match query * Fixes link * Adds note to the Semantic query page --------- Co-authored-by: Liam Thompson <[email protected]>
💚 Backport successful
|
* Adds Querying semantic_text fields section * Update docs/reference/elasticsearch/mapping-reference/semantic-text.md * Comment out links temporarily * Update docs/reference/elasticsearch/mapping-reference/semantic-text.md * Update docs/reference/elasticsearch/mapping-reference/semantic-text.md * Update docs/reference/elasticsearch/mapping-reference/semantic-text.md * Update docs/reference/elasticsearch/mapping-reference/semantic-text.md * Adds ESQL link to match query * Fixes link * Adds note to the Semantic query page --------- Co-authored-by: Liam Thompson <[email protected]>
This PR adds a new section to the semantic_text field type documentation with quick links to examples for querying
semantic_text
fields using different query types (match, kNN, sparse_vector, and semantic).The links to the specific query type examples will be added by @charlotte-hoblik in her PR, as she’s currently working on creating those example pages.
Related issue: https://github.com/elastic/developer-docs-team/issues/321