-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Add more dense_vector details for cluster stats field stats #113607
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
Add more dense_vector details for cluster stats field stats #113607
Conversation
Documentation preview: |
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
Hi @benwtrent, I've created a changelog YAML for you. |
indexedVectorDimMax = UNSET; | ||
} | ||
|
||
DenseVectorFieldStats(StreamInput in) throws IOException { |
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 noticed that this isn't actually used anywhere. I am going to double check that this is ok. But the underlying fieldstats
serialization isn't via named writables & consequently the DenseVectorFieldStats
is never actually written or read.
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.
+1 to remove
…ub.com:benwtrent/elasticsearch into feature/add-dense-vector-details-cluster-stats
@elasticmachine update branch |
server/src/main/java/org/elasticsearch/action/admin/cluster/stats/DenseVectorFieldStats.java
Outdated
Show resolved
Hide resolved
stats = fieldTypes.computeIfAbsent(type, DenseVectorFieldStats::new); | ||
boolean indexed = fieldMapping.containsKey("index") ? (boolean) fieldMapping.get("index") : false; | ||
DenseVectorFieldStats vStats = (DenseVectorFieldStats) stats; | ||
if (fieldMapping.containsKey("similarity")) { |
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 thought similarity
can only be provided when indexed=true
? Should we put this under indexed
(line 101)?
DenseVectorFieldStats vStats = (DenseVectorFieldStats) stats; | ||
Object indexOptions = fieldMapping.get("index_options"); | ||
// NOTE, while the default for `float` is now `int8_hnsw`, that is actually added to the mapping | ||
// if the value is truly missing & we are indexed, we default to hnsw. |
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.
Under what condition this could happen that the value for index_options.type
is missing?
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.
@mayya-sharipova when we default to index: true
, but the element type is byte
. in that scenario we won't provide a value to the mapping and its instead hnsw
.
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.
@benwtrent Thanks, nice addition to vector stats. I left a couple of comments.
...c/src/yamlRestTest/resources/rest-api-spec/test/search.vectors/70_dense_vector_telemetry.yml
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/admin/cluster/stats/DenseVectorFieldStats.java
Outdated
Show resolved
Hide resolved
…ector-details-cluster-stats
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.
💯
@elasticmachine update branch |
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.
LGTM, with just a minor comment
Map<String, Integer> vectorIndexTypeCount; // count of mappings by index type | ||
Map<String, Integer> vectorSimilarityTypeCount; // count of mappings by similarity | ||
Map<String, Integer> vectorElementTypeCount; // count of mappings by element type |
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.
should we be concerned about these becoming huge (and hence OOMs & co)?
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.
@tteofili I wouldn't think so. We have a static number of element types, index types, and similarity types. Since we are counting each separately, we won't have combinatoric explosion. These each will be hashmaps of < 10 elements each or so.
…113607) This adds some more counts for dense_vector field mapping stats. This allows for seeing the number of mappings with a given element type, similarity, or index type.
💚 Backport successful
|
…#113884) This adds some more counts for dense_vector field mapping stats. This allows for seeing the number of mappings with a given element type, similarity, or index type. Co-authored-by: Elastic Machine <[email protected]>
…113607) This adds some more counts for dense_vector field mapping stats. This allows for seeing the number of mappings with a given element type, similarity, or index type.
This adds some more counts for dense_vector field mapping stats. This allows for seeing the number of mappings with a given element type, similarity, or index type.