@@ -77,7 +77,7 @@ import io.endee.client.types.SpaceType;
7777
7878CreateIndexOptions options = CreateIndexOptions . builder(" my_vectors" , 384 )
7979 .spaceType(SpaceType . COSINE )
80- .precision(Precision . INT8D )
80+ .precision(Precision . INT8 )
8181 .build();
8282
8383client. createIndex(options);
@@ -92,7 +92,7 @@ client.createIndex(options);
9292| ` spaceType ` | Distance metric - ` COSINE ` , ` L2 ` , or ` IP ` (inner product) | ` COSINE ` |
9393| ` m ` | Graph connectivity - higher values increase recall but use more memory | 16 |
9494| ` efCon ` | Construction-time parameter - higher values improve index quality | 128 |
95- | ` precision ` | Quantization precision | ` INT8D ` |
95+ | ` precision ` | Quantization precision | ` INT8 ` |
9696
9797### Create a Hybrid Index
9898
@@ -102,7 +102,7 @@ Hybrid indexes combine dense vector search with sparse vector search. Add the `s
102102CreateIndexOptions options = CreateIndexOptions . builder(" hybrid_index" , 384 )
103103 .sparseDimension(30000 ) // Sparse vector dimension (vocabulary size)
104104 .spaceType(SpaceType . COSINE )
105- .precision(Precision . INT8D )
105+ .precision(Precision . INT8 )
106106 .build();
107107
108108client. createIndex(options);
@@ -189,12 +189,14 @@ for (QueryResult item : results) {
189189
190190** Query Parameters:**
191191
192- | Parameter | Description | Default | Max |
193- | ---------------- | ------------------------------------------------------- | -------- | ---- |
194- | ` vector ` | Query vector (must match index dimension) | Required | - |
195- | ` topK ` | Number of results to return | 10 | 512 |
196- | ` ef ` | Search quality parameter - higher values improve recall | 128 | 1024 |
197- | ` includeVectors ` | Include vector data in results | false | - |
192+ | Parameter | Description | Default | Max |
193+ | -------------------------------- | ------------------------------------------------------- | ------- | --------- |
194+ | ` vector ` | Query vector (must match index dimension) | Required | - |
195+ | ` topK ` | Number of results to return | 10 | 512 |
196+ | ` ef ` | Search quality parameter - higher values improve recall | 128 | 1024 |
197+ | ` includeVectors ` | Include vector data in results | false | - |
198+ | ` prefilterCardinalityThreshold ` | Switch to postfiltering when estimated matches exceed this value | 10,000 | 1,000,000 |
199+ | ` filterBoostPercentage ` | Bias results toward filter matches (0 = disabled) | 0 | 100 |
198200
199201## Filtered Querying
200202
@@ -223,6 +225,29 @@ List<QueryResult> results = index.query(
223225
224226> ** Note:** The ` $range ` operator supports values within ** [ 0 - 999] ** . Normalize larger values before upserting.
225227
228+ ### Filter Params
229+
230+ Use ` prefilterCardinalityThreshold ` and ` filterBoostPercentage ` to fine-tune how filtering interacts with the ANN search:
231+
232+ ``` java
233+ List<QueryResult > results = index. query(
234+ QueryOptions . builder()
235+ .vector(new double [] {0.15 , 0.25 /* ... */ })
236+ .topK(5 )
237+ .filter(List . of(
238+ Map . of(" category" , Map . of(" $eq" , " tech" ))
239+ ))
240+ .prefilterCardinalityThreshold(50_000 ) // Use postfilter when >50k vectors match
241+ .filterBoostPercentage(20 ) // Bias 20% toward filter-matching vectors
242+ .build()
243+ );
244+ ```
245+
246+ | Parameter | Description | Default | Range |
247+ | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | ------- | ----------------- |
248+ | ` prefilterCardinalityThreshold ` | When the estimated number of vectors matching the filter exceeds this value, postfiltering is used instead of prefiltering. | 10,000 | 1,000–1,000,000 |
249+ | ` filterBoostPercentage ` | Percentage by which filter-matching vectors are boosted during scoring. Set to ` 0 ` to disable. Higher values favor filtered results. | 0 | 0–100 |
250+
226251## Hybrid Search
227252
228253### Upserting Hybrid Vectors
@@ -340,7 +365,7 @@ IndexDescription info = index.describe();
340365System . out. println(info);
341366// IndexDescription{name='my_index', spaceType=COSINE, dimension=384,
342367// sparseDimension=0, isHybrid=false, count=1000,
343- // precision=INT8D , m=16}
368+ // precision=INT8 , m=16}
344369```
345370
346371### Check if Index is Hybrid
@@ -357,8 +382,8 @@ Endee supports different quantization precision levels:
357382import io.endee.client.types.Precision ;
358383
359384Precision . BINARY // Binary quantization (1-bit) - smallest storage, fastest search
360- Precision . INT8D // 8-bit integer quantization (default) - balanced performance
361- Precision . INT16D // 16-bit integer quantization - higher precision
385+ Precision . INT8 // 8-bit integer quantization (default) - balanced performance
386+ Precision . INT16 // 16-bit integer quantization - higher precision
362387Precision . FLOAT16 // 16-bit floating point - good balance
363388Precision . FLOAT32 // 32-bit floating point - highest precision
364389```
@@ -368,8 +393,8 @@ Precision.FLOAT32 // 32-bit floating point - highest precision
368393| Precision | Use Case |
369394| --------- | ------------------------------------------------------------------------- |
370395| ` BINARY ` | Very large datasets where speed and storage are critical |
371- | ` INT8D ` | Recommended for most use cases - good balance of accuracy and performance |
372- | ` INT16D ` | Better accuracy than INT8D but less storage than FLOAT32 |
396+ | ` INT8 ` | Recommended for most use cases - good balance of accuracy and performance |
397+ | ` INT16 ` | Better accuracy than INT8 but less storage than FLOAT32 |
373398| ` FLOAT16 ` | Good compromise between precision and storage for embeddings |
374399| ` FLOAT32 ` | Maximum precision when storage is not a concern |
375400
@@ -435,7 +460,7 @@ public class EndeeExample {
435460 // Create a dense index
436461 CreateIndexOptions createOptions = CreateIndexOptions . builder(" documents" , 384 )
437462 .spaceType(SpaceType . COSINE )
438- .precision(Precision . INT8D )
463+ .precision(Precision . INT8 )
439464 .build();
440465
441466 client. createIndex(createOptions);
@@ -515,7 +540,7 @@ CreateIndexOptions.builder(String name, int dimension)
515540 .spaceType(SpaceType ) // Default: COSINE
516541 .m(int ) // Default: 16
517542 .efCon(int ) // Default: 128
518- .precision(Precision ) // Default: INT8D
543+ .precision(Precision ) // Default: INT8
519544 .sparseDimension(Integer ) // Optional, for hybrid indexes
520545 .build()
521546```
@@ -525,12 +550,14 @@ CreateIndexOptions.builder(String name, int dimension)
525550``` java
526551QueryOptions . builder()
527552 .vector(double []) // Required for dense search
528- .topK(int ) // Required
529- .ef(int ) // Default: 128
553+ .topK(int ) // Default: 10, max 512
554+ .ef(int ) // Default: 128, max 1024
530555 .filter(List<Map<String , Object > > ) // Optional
531556 .includeVectors(boolean ) // Default: false
532557 .sparseIndices(int []) // Optional, for hybrid search
533558 .sparseValues(double []) // Optional, for hybrid search
559+ .prefilterCardinalityThreshold(int ) // Default: 10000, range 1000–1000000
560+ .filterBoostPercentage(int ) // Default: 0, range 0–100
534561 .build()
535562```
536563
0 commit comments