Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ public class DenseVectorIndexOptions implements JsonpSerializable {
@Nullable
private final Boolean onDiskRescore;

@Nullable
private final Integer flatIndexThreshold;

// ---------------------------------------------------------------------------------------------

private DenseVectorIndexOptions(Builder builder) {
Expand All @@ -89,6 +92,7 @@ private DenseVectorIndexOptions(Builder builder) {
this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type");
this.rescoreVector = builder.rescoreVector;
this.onDiskRescore = builder.onDiskRescore;
this.flatIndexThreshold = builder.flatIndexThreshold;

}

Expand Down Expand Up @@ -183,6 +187,24 @@ public final Boolean onDiskRescore() {
return this.onDiskRescore;
}

/**
* The segment document count threshold below which HNSW graph construction is
* skipped in favor of brute-force flat search. <code>-1</code> (default) defers
* to format defaults: <code>300</code> for <code>bbq_hnsw</code>,
* <code>150</code> for <code>hnsw</code>, <code>int8_hnsw</code>, and
* <code>int4_hnsw</code>. <code>0</code> always builds the graph. A positive
* value overrides the format default.
* <p>
* Only applicable to <code>hnsw</code>, <code>int8_hnsw</code>,
* <code>int4_hnsw</code>, and <code>bbq_hnsw</code> index types.
* <p>
* API name: {@code flat_index_threshold}
*/
@Nullable
public final Integer flatIndexThreshold() {
return this.flatIndexThreshold;
}

/**
* Serialize this object to JSON.
*/
Expand Down Expand Up @@ -221,6 +243,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.write(this.onDiskRescore);

}
if (this.flatIndexThreshold != null) {
generator.writeKey("flat_index_threshold");
generator.write(this.flatIndexThreshold);

}

}

Expand Down Expand Up @@ -255,6 +282,9 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>
@Nullable
private Boolean onDiskRescore;

@Nullable
private Integer flatIndexThreshold;

public Builder() {
}
private Builder(DenseVectorIndexOptions instance) {
Expand All @@ -264,6 +294,7 @@ private Builder(DenseVectorIndexOptions instance) {
this.type = instance.type;
this.rescoreVector = instance.rescoreVector;
this.onDiskRescore = instance.onDiskRescore;
this.flatIndexThreshold = instance.flatIndexThreshold;

}
/**
Expand Down Expand Up @@ -367,6 +398,24 @@ public final Builder onDiskRescore(@Nullable Boolean value) {
return this;
}

/**
* The segment document count threshold below which HNSW graph construction is
* skipped in favor of brute-force flat search. <code>-1</code> (default) defers
* to format defaults: <code>300</code> for <code>bbq_hnsw</code>,
* <code>150</code> for <code>hnsw</code>, <code>int8_hnsw</code>, and
* <code>int4_hnsw</code>. <code>0</code> always builds the graph. A positive
* value overrides the format default.
* <p>
* Only applicable to <code>hnsw</code>, <code>int8_hnsw</code>,
* <code>int4_hnsw</code>, and <code>bbq_hnsw</code> index types.
* <p>
* API name: {@code flat_index_threshold}
*/
public final Builder flatIndexThreshold(@Nullable Integer value) {
this.flatIndexThreshold = value;
return this;
}

@Override
protected Builder self() {
return this;
Expand Down Expand Up @@ -408,6 +457,7 @@ protected static void setupDenseVectorIndexOptionsDeserializer(
op.add(Builder::type, DenseVectorIndexOptionsType._DESERIALIZER, "type");
op.add(Builder::rescoreVector, DenseVectorIndexOptionsRescoreVector._DESERIALIZER, "rescore_vector");
op.add(Builder::onDiskRescore, JsonpDeserializer.booleanDeserializer(), "on_disk_rescore");
op.add(Builder::flatIndexThreshold, JsonpDeserializer.integerDeserializer(), "flat_index_threshold");

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -883,9 +883,9 @@
'_types.mapping.DateProperty': '_types/mapping/core.ts#L78-L90',
'_types.mapping.DateRangeProperty': '_types/mapping/range.ts#L29-L32',
'_types.mapping.DenseVectorElementType': '_types/mapping/DenseVectorProperty.ts#L64-L85',
'_types.mapping.DenseVectorIndexOptions': '_types/mapping/DenseVectorProperty.ts#L134-L179',
'_types.mapping.DenseVectorIndexOptionsRescoreVector': '_types/mapping/DenseVectorProperty.ts#L237-L245',
'_types.mapping.DenseVectorIndexOptionsType': '_types/mapping/DenseVectorProperty.ts#L181-L235',
'_types.mapping.DenseVectorIndexOptions': '_types/mapping/DenseVectorProperty.ts#L134-L189',
'_types.mapping.DenseVectorIndexOptionsRescoreVector': '_types/mapping/DenseVectorProperty.ts#L247-L255',
'_types.mapping.DenseVectorIndexOptionsType': '_types/mapping/DenseVectorProperty.ts#L191-L245',
'_types.mapping.DenseVectorProperty': '_types/mapping/DenseVectorProperty.ts#L23-L62',
'_types.mapping.DenseVectorSimilarity': '_types/mapping/DenseVectorProperty.ts#L87-L132',
'_types.mapping.DocValuesPropertyBase': '_types/mapping/core.ts#L53-L55',
Expand Down Expand Up @@ -3562,10 +3562,10 @@
if (hash.length > 1) {
hash = hash.substring(1);
}
window.location = "https://github.com/elastic/elasticsearch-specification/tree/a11ffef0fa62bc289d624a0dde052163740ee4bf/specification/" + (paths[hash] || "");
window.location = "https://github.com/elastic/elasticsearch-specification/tree/ea5cd764eeab3a374bc18999c0ea39e554e62d2d/specification/" + (paths[hash] || "");
</script>
</head>
<body>
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/a11ffef0fa62bc289d624a0dde052163740ee4bf/specification/">Elasticsearch API specification</a>.
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/ea5cd764eeab3a374bc18999c0ea39e554e62d2d/specification/">Elasticsearch API specification</a>.
</body>
</html>
Loading