Skip to content

Conversation

mridula-s109
Copy link
Contributor

Summary

Clarifies that the docs.count field in the _cat/indices API includes hidden nested documents, which can lead to higher counts than expected when using field types like semantic_text.

Changes

  • Updated the documentation for docs.count in CatIndicesRequest.ts to explicitly state that it includes nested documents
  • Added guidance to use _count or _cat/count APIs for logical document count

Related Issues

Fixes #127354

Related PRs

  • elasticsearch #136329 (semantic_text documentation update)
Copy link
Contributor

github-actions bot commented Oct 15, 2025

Following you can find the validation changes against the target branch for the APIs.

API Status Request Response
get 🟢 317/317 → 321/321 314/314 → 318/318
index 🟢 1440/1440 → 1445/1445 1442/1442 → 1447/1447
indices.create 🔴 1373/1397 → 1378/1402 1397/1397 → 1402/1402
indices.get_mapping 🔴 198/198 → 202/202 187/198 → 191/202
search 🔴 2584/2611 → 2585/2612 2611/2611 → 2612/2612

You can validate these APIs yourself by using the make validate target.

Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM.

@lcawl
Copy link
Contributor

lcawl commented Oct 15, 2025

I generated the output and confirmed that it appears in a docs preview:

image
Copy link
Contributor

@lcawl lcawl left a comment

Choose a reason for hiding this comment

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

Docs output LGTM

Copy link

@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, I left a small question about the inclusion of newlines

},
"docs.count": {
"description": "available docs",
"description": "The number of documents in the index, including hidden nested documents.\nFor indices with `semantic_text` fields or other nested field types,\nthis count includes the internal nested documents.\nTo get the logical document count (excluding nested documents), use\nthe `_count` API or `_cat/count` API instead.",
Copy link

@Mikep86 Mikep86 Oct 17, 2025

Choose a reason for hiding this comment

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

Nit: Do we want/need newlines in the JSON like this? Honest question, I don't know how they affect downstream rendering of the spec.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is automatic, don't think need to be concerned about this. Lisa's preview LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation enhancement skip-backport This pull request should not be backported specification

5 participants