Skip to content

Conversation

@kosabogi
Copy link
Contributor

This PR merges the "Troubleshooting semantic_text fields" section into the "Returning semantic field embeddings in _source" section to reduce duplication and improve clarity.
It also adds an annotated example response that explains key fields (inference_id, model_settings and embeddings) in the _inference_fields object.

Related issue: elastic/docs-content#2955
(The scope of this issue has changed, as per this comment and my discussion with @Mikep86 )

@kosabogi kosabogi requested a review from Mikep86 October 28, 2025 08:49
@kosabogi kosabogi added >docs General docs changes Team:Docs Meta label for docs team v9.0.0 v9.1.0 v9.2.0 labels Oct 28, 2025
@kosabogi kosabogi changed the title Consolidates troubleshooting content into Returning semantic field embeddings section Consolidates troubleshooting content into the "Returning semantic field embeddings in _source" section Oct 28, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/core-docs (Team:Docs)

@github-actions
Copy link
Contributor

github-actions bot commented Oct 28, 2025

🔍 Preview links for changed docs

@github-actions
Copy link
Contributor

ℹ️ 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 overview

When to use applies_to tags:

✅ At the page level to indicate which products/deployments the content applies to (mandatory)
✅ When features change state (e.g. preview, ga) in a specific version
✅ When availability differs across deployments and environments

What NOT to do:

❌ Don't remove or replace information that applies to an older version
❌ Don't add new information that applies to a specific version without an applies_to tag
❌ Don't forget that applies_to tags can be used at the page, section, and inline level

🤔 Need help?

@kosabogi kosabogi requested review from a team and removed request for a team October 29, 2025 15:52
Copy link
Contributor

@Mikep86 Mikep86 left a comment

Choose a reason for hiding this comment

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

Looks pretty good overall, thank you for following up on this! I left a couple comments about some minor adjustments we should consider.

},
"fields": [
"_inference_fields"
]
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use the version with exclude_vectors to false, this is the preferred way to retrieve the field.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your suggestions, @jimczi!
I deleted the unnecessary "_inference_fields" where we use exclude_vectors.
As Mike suggested in his comment, I created two versions of this: one for 9.0 and 9.1 versions and one for 9.2 since exclude_vectors: false was added only in the 9.2 version.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we start with the preferred and current way of doing things? We can document the old way but it should be a small warning section without needing to repeat the entire response (it's the same).

Copy link
Contributor Author

@kosabogi kosabogi Nov 3, 2025

Choose a reason for hiding this comment

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

I’ve reordered the sections so that the 9.2 method appears first.
I also added a warning to the 9.0-9.1 method to emphasize that users on 9.2 or later should use the newer approach instead.

I thought it might work better to keep both methods as equivalent sections instead of putting the 9.0-9.1 version in a warning. Since this documentation set covers all versions starting from 9.0, it feels clearer to show both approaches while highlighting which versions they apply to. I labeled the current recommended method as applicable from version 9.2 to make that distinction clear.

Let me know what you think!

@kosabogi kosabogi marked this pull request as draft October 31, 2025 10:29
@kosabogi kosabogi marked this pull request as ready for review October 31, 2025 11:37
@kosabogi kosabogi requested review from Mikep86 and jimczi October 31, 2025 11:37
Copy link
Contributor

@Mikep86 Mikep86 left a comment

Choose a reason for hiding this comment

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

The content looks good, thank you for the iterations! I left one comment about mentioning serverless in the applies_to tag.

Tangential to this PR, I think we can make a few changes to Example: Reindex while preserving embeddings to make it clearer:

  • Use an applies_to tag to indicate that this example only applies to 9.2+ and serverless
  • Remove the section that uses the fields param. The fields param can't be used during reindexing, so mentioning it as part of reindexing is confusing.

That change could be it's own PR though. WDYT?

@kosabogi
Copy link
Contributor Author

kosabogi commented Nov 4, 2025

The content looks good, thank you for the iterations! I left one comment about mentioning serverless in the applies_to tag.

Tangential to this PR, I think we can make a few changes to Example: Reindex while preserving embeddings to make it clearer:

  • Use an applies_to tag to indicate that this example only applies to 9.2+ and serverless
  • Remove the section that uses the fields param. The fields param can't be used during reindexing, so mentioning it as part of reindexing is confusing.

That change could be it's own PR though. WDYT?

Thank you, really good catches!
I applied your suggestions in this PR, as I felt it would be confusing without them.

In my latest commit, I made the following changes:

  • Added an applies-to tag to the Example: Reindex while preserving embeddings section.
  • Removed the note that mentioned the fields parameter, since we now show the method for retrieving embeddings for earlier versions (pre-9.2) in a dedicated section.
  • Renamed the Returning semantic field embeddings for 9.0–9.1 section to Returning semantic field embeddings using fields to stay consistent with the Returning semantic field embeddings in source title.
  • Moved the Returning semantic field embeddings using fields section one level higher. I did this because it makes more sense for it to be a separate section rather than part of Returning semantic field embeddings in source, as it describes a different method.
  • At the beginning of the Returning semantic field embeddings using fields section, I added a warning to clarify that this applies only to Elasticsearch versions earlier than 9.2, and that users on 9.2+ should refer to the other section.
  • At the beginning of the Returning semantic field embeddings in source section, I added a note linking to the section that explains the method for earlier versions.

What do you think about it now?

@kosabogi kosabogi requested a review from Mikep86 November 4, 2025 14:31
Copy link
Contributor

@Mikep86 Mikep86 left a comment

Choose a reason for hiding this comment

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

Structure looks good to me, I left a few comments about minor edits

@kosabogi kosabogi requested a review from Mikep86 November 5, 2025 08:54
Copy link
Contributor

@Mikep86 Mikep86 left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for the iterations!

Copy link
Contributor

@jimczi jimczi left a comment

Choose a reason for hiding this comment

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

Sorry I didn't meant to block the merging with my old request for changes. :LGTM

@kosabogi kosabogi requested a review from a team November 6, 2025 08:58
Copy link
Contributor

@szabosteve szabosteve left a comment

Choose a reason for hiding this comment

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

I left a few comments.

3. The embeddings generated for this chunk.

## Returning semantic field embeddings using `fields` [return-embeddings-fields]

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason not to add an applies_to tag that lists 9.0 and 9.1 and marks it unavailable from 9.2?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes - I didn’t want to mark this as unavailable from 9.2, since it’s not technically unavailable, it’s just not recommended to use.
I thought specifically listing 9.0 and 9.1 might be a bit misleading, as it could imply that this parameter is only available starting from 9.0. But I’m open to adding the 9.0 and 9.1 tags here, I was thinking about that myself too. Do you think it would be better?

@kosabogi kosabogi requested a review from szabosteve November 6, 2025 10:03
Copy link
Contributor

@leemthompo leemthompo left a comment

Choose a reason for hiding this comment

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

If Jim and Mike are happy, I'm happy 😄 and we'll revisit this page to break it up into logical subpages and cleanup versioning conditionals as much as possible in future work

Thx!

@kosabogi kosabogi merged commit 02ea910 into elastic:main Nov 6, 2025
11 checks passed
afoucret pushed a commit to afoucret/elasticsearch that referenced this pull request Nov 6, 2025
…ld embeddings in _source" section (elastic#137233)

* Consolidates the Troubleshooting section

* Update docs/reference/elasticsearch/mapping-reference/semantic-text.md

Co-authored-by: Mike Pellegrini <[email protected]>

* Test applies switch tabs

* Adds version specific examples

* Syntax fix

* Fixes syntax

* Adds separate tabs for each versions

* Adds only two version tahs

* Deletes tabs, uses section level applies-to instead

* Removes response block, adds intros and warning

* Reorganizes content, adds applies_to where necessary

* Update docs/reference/elasticsearch/mapping-reference/semantic-text.md

Co-authored-by: Mike Pellegrini <[email protected]>

* Update docs/reference/elasticsearch/mapping-reference/semantic-text.md

Co-authored-by: Mike Pellegrini <[email protected]>

* Adds additional information, changes admonition types

* Update docs/reference/elasticsearch/mapping-reference/semantic-text.md

Co-authored-by: István Zoltán Szabó <[email protected]>

* Shorten tab titles

---------

Co-authored-by: Mike Pellegrini <[email protected]>
Co-authored-by: István Zoltán Szabó <[email protected]>
szybia added a commit to szybia/elasticsearch that referenced this pull request Nov 6, 2025
…-json

* upstream/main:
  Mute org.elasticsearch.xpack.inference.action.filter.ShardBulkInferenceActionFilterBasicLicenseIT testLicenseInvalidForInference {p0=false} elastic#137691
  Mute org.elasticsearch.xpack.inference.action.filter.ShardBulkInferenceActionFilterBasicLicenseIT testLicenseInvalidForInference {p0=true} elastic#137690
  [LTR] Fix feature display order when using explain. (elastic#137671)
  Remove extra RemoteClusterService instances in unit test (elastic#137647)
  Fix `ComponentTemplatesFileSettingsIT.testSettingsApplied` (elastic#137669)
  Consolidates troubleshooting content into the "Returning semantic field embeddings in _source" section (elastic#137233)
  Update bundled JDK to 25.0.1 (elastic#137640)
  resolve indices for prefixed _all expressions (elastic#137330)
  ESQL: Add TopN support for exponential histograms (elastic#137313)
  allows field caps to be cross project (elastic#137530)
  ESQL: Add exponential histogram percentile function (elastic#137553)
  Wait for nodes to have downloaded databases in `GeoIpDownloaderIT` (elastic#137636)
  Tighten on when THROTTLE decision can be returned (elastic#136794)
  Mute org.elasticsearch.xpack.esql.qa.single_node.GenerativeMetricsIT test elastic#137655
  Add a test for two little known conditional processor paths (elastic#137645)
  Extract a common ORIGIN constant (elastic#137612)
  Remove early phase failure in batched (elastic#136889)
  Returning correct index mode from get data streams api (elastic#137646)
  [ML] Manage AD results indices (elastic#136065)
szybia added a commit to szybia/elasticsearch that referenced this pull request Nov 6, 2025
…-json

* upstream/main:
  Mute org.elasticsearch.xpack.inference.action.filter.ShardBulkInferenceActionFilterBasicLicenseIT testLicenseInvalidForInference {p0=false} elastic#137691
  Mute org.elasticsearch.xpack.inference.action.filter.ShardBulkInferenceActionFilterBasicLicenseIT testLicenseInvalidForInference {p0=true} elastic#137690
  [LTR] Fix feature display order when using explain. (elastic#137671)
  Remove extra RemoteClusterService instances in unit test (elastic#137647)
  Fix `ComponentTemplatesFileSettingsIT.testSettingsApplied` (elastic#137669)
  Consolidates troubleshooting content into the "Returning semantic field embeddings in _source" section (elastic#137233)
  Update bundled JDK to 25.0.1 (elastic#137640)
  resolve indices for prefixed _all expressions (elastic#137330)
  ESQL: Add TopN support for exponential histograms (elastic#137313)
  allows field caps to be cross project (elastic#137530)
  ESQL: Add exponential histogram percentile function (elastic#137553)
  Wait for nodes to have downloaded databases in `GeoIpDownloaderIT` (elastic#137636)
  Tighten on when THROTTLE decision can be returned (elastic#136794)
  Mute org.elasticsearch.xpack.esql.qa.single_node.GenerativeMetricsIT test elastic#137655
  Add a test for two little known conditional processor paths (elastic#137645)
  Extract a common ORIGIN constant (elastic#137612)
  Remove early phase failure in batched (elastic#136889)
  Returning correct index mode from get data streams api (elastic#137646)
  [ML] Manage AD results indices (elastic#136065)
Kubik42 pushed a commit to Kubik42/elasticsearch that referenced this pull request Nov 10, 2025
…ld embeddings in _source" section (elastic#137233)

* Consolidates the Troubleshooting section

* Update docs/reference/elasticsearch/mapping-reference/semantic-text.md

Co-authored-by: Mike Pellegrini <[email protected]>

* Test applies switch tabs

* Adds version specific examples

* Syntax fix

* Fixes syntax

* Adds separate tabs for each versions

* Adds only two version tahs

* Deletes tabs, uses section level applies-to instead

* Removes response block, adds intros and warning

* Reorganizes content, adds applies_to where necessary

* Update docs/reference/elasticsearch/mapping-reference/semantic-text.md

Co-authored-by: Mike Pellegrini <[email protected]>

* Update docs/reference/elasticsearch/mapping-reference/semantic-text.md

Co-authored-by: Mike Pellegrini <[email protected]>

* Adds additional information, changes admonition types

* Update docs/reference/elasticsearch/mapping-reference/semantic-text.md

Co-authored-by: István Zoltán Szabó <[email protected]>

* Shorten tab titles

---------

Co-authored-by: Mike Pellegrini <[email protected]>
Co-authored-by: István Zoltán Szabó <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>docs General docs changes Team:Docs Meta label for docs team v9.0.0 v9.1.0 v9.2.0 v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants