Skip to content

Report vectordb_document usage in _xpack/usage - #152780

Merged
elasticsearchmachine merged 7 commits into
elastic:mainfrom
mayya-sharipova:vectordb_document-index-mode-stats
Jul 3, 2026
Merged

elasticsearchmachine merged 7 commits into
elastic:mainfrom
mayya-sharipova:vectordb_document-index-mode-stats

Conversation

@mayya-sharipova

@mayya-sharipova mayya-sharipova commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Add a vectordb_document section to the _xpack/usage API, following the same pattern already used for logsdb and time_series. VectorDBDocumentUsageTransportAction counts indices with index.mode=vectordb_document from cluster state and fetches aggregated doc counts via IndexModeStatsActionType.

Sample response with no vectordb_document indices:

{
  "vectordb_document": {
    "available": true,
    "enabled": true,
    "indices_count": 0,
    "num_docs": 0
  }
}

Sample response with one index holding 2 documents:

{
  "vectordb_document": {
    "available": true,
    "enabled": true,
    "indices_count": 1,
    "num_docs": 2
  }
}

Add a vectordb_document section to the _xpack/usage API,
following the same pattern already used for logsdb and
time_series. VectorDBDocumentUsageTransportAction counts
indices with index.mode=vectordb_document from cluster state
and fetches aggregated doc counts via IndexModeStatsActionType.

Sample response with no vectordb_document indices:

{
  "vectordb_document": {
    "available": true,
    "enabled": true,
    "indices_count": 0,
    "num_docs": 0
  }
}

Sample response with one index holding 2 documents:

{
  "vectordb_document": {
    "available": true,
    "enabled": true,
    "indices_count": 1,
    "num_docs": 2
  }
}
@elasticsearchmachine elasticsearchmachine added the Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch label Jul 2, 2026
@elasticsearchmachine

Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-search-relevance (Team:Search Relevance)

VectorDBDocumentFeatureSetUsage is a new named writeable, so
it needs its own TransportVersion instead of reusing
minimumCompatible() or the unrelated index-mode constant.

Also drop the redundant IndexMetadata scan for indices_count:
IndexModeStatsActionType's response already carries numIndices
from the same fan-out used for num_docs, so there is no need
for a second, separate pass over cluster state.
@elasticsearchmachine

Copy link
Copy Markdown
Collaborator

Hi @mayya-sharipova, I've created a changelog YAML for you.

@github-actions

github-actions Bot commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

🔍 Preview links for changed docs

⏳ Building and deploying preview... View progress

This comment will be updated with preview links when the build is complete.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
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?

The yaml test asserted on the vectordb_document usage section
unconditionally, which would fail if it ever ran against a
mixed cluster with nodes predating this feature. Register a
test-only NodeFeature and require it, so the test skips
cleanly instead. Nothing in production code branches on this
feature, so it belongs in getTestFeatures(), not getFeatures().
@mayya-sharipova mayya-sharipova added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Jul 2, 2026
OperatorPrivilegesIT requires every action to be declared
either operator-only or non-operator. The new usage action was
missing, matching every other _xpack/usage feature action.
…ndex-mode-stats

# Conflicts:
#	server/src/main/resources/transport/upper_bounds/9.5.csv
@elasticsearchmachine
elasticsearchmachine merged commit a7e2dbe into elastic:main Jul 3, 2026
36 checks passed
@mayya-sharipova
mayya-sharipova deleted the vectordb_document-index-mode-stats branch July 3, 2026 17:19
szybia added a commit to szybia/elasticsearch that referenced this pull request Jul 3, 2026
…uisition

* upstream/main: (65 commits)
  Use forceEvictEntries for all forceEvict methods (elastic#152846)
  [ESQL] Normalize local StorageObject path for stats reconcile (elastic#152837)
  Report vectordb_document usage in _xpack/usage (elastic#152780)
  Mute org.elasticsearch.common.lucene.LuceneTests testSearchWithoutBulkScorer elastic#152898
  Make DiskBBQ CentroidSupplier generic in the indexing method (elastic#152863)
  AGGS: Prevent OOM in test (elastic#152690)
  [CI] Fix bc upgrade disk size (elastic#152895)
  Mute org.elasticsearch.xpack.transform.integration.TransformIT testStopWaitForCheckpoint elastic#149663
  Always report script queries as maximum cost (elastic#152856)
  test(tsdb): cover `ES95` ordinal doc values (elastic#152802)
  Skip semantic_field source yaml tests in release (elastic#152852)
  Mute org.elasticsearch.xpack.esql.action.NdJsonScalarObjectConflictIT testSkipRowPolicyNullFillsAndWarnsClient elastic#152891
  [ESQL] Async STOP / cancel / DELETE contract for EXTERNAL queries (elastic#152585)
  Unmute rolling upgrade tests (elastic#152715)
  [ESQL] Fix ExternalSourceExec BWC serialization test types (elastic#152836)
  Add AllocateReshardSplitTargetPrimaryCommand (elastic#152806)
  [ESQL] Reconcile temporal stat units in cross-file merge (elastic#152859)
  ES|QL: error on `match` options w/ runtime field (elastic#152597)
  Improve allocation explain API for canRemain decisions (elastic#152121)
  [Inference API] Remove fallbackRegion from RegionPolicy (elastic#152798)
  ...
burqen pushed a commit to burqen/elasticsearch that referenced this pull request Jul 7, 2026
Add a vectordb_document section to the _xpack/usage API, following the
same pattern already used for logsdb and time_series.
VectorDBDocumentUsageTransportAction counts indices with
index.mode=vectordb_document from cluster state and fetches aggregated
doc counts via IndexModeStatsActionType.

Sample response with no vectordb_document indices:

```js
{
  "vectordb_document": {
    "available": true,
    "enabled": true,
    "indices_count": 0,
    "num_docs": 0
  }
}
```

Sample response with one index holding 2 documents:

```
{
  "vectordb_document": {
    "available": true,
    "enabled": true,
    "indices_count": 1,
    "num_docs": 2
  }
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) >enhancement :Search Relevance/Vectors Vector search Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants