Package io.milvus.client
Class SearchParam.Builder
- java.lang.Object
-
- io.milvus.client.SearchParam.Builder
-
- Enclosing class:
- SearchParam
public static class SearchParam.Builder extends java.lang.Object
Builder forSearchParam
-
-
Constructor Summary
Constructors Constructor Description Builder(java.lang.String collectionName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SearchParam
build()
SearchParam.Builder
withBinaryVectors(java.util.List<java.nio.ByteBuffer> binaryVectors)
Default to an emptyArrayList
.SearchParam.Builder
withFloatVectors(java.util.List<java.util.List<java.lang.Float>> floatVectors)
Default to an emptyArrayList
.SearchParam.Builder
withParamsInJson(java.lang.String paramsInJson)
Optional.SearchParam.Builder
withPartitionTags(java.util.List<java.lang.String> partitionTags)
Optional.SearchParam.Builder
withTopK(long topK)
Optional.
-
-
-
Method Detail
-
withFloatVectors
public SearchParam.Builder withFloatVectors(@Nonnull java.util.List<java.util.List<java.lang.Float>> floatVectors)
Default to an emptyArrayList
. You can search either float or binary vectors, not both.- Parameters:
floatVectors
- aList
of float vectors to be queries. Each innerList
represents a float vector.- Returns:
Builder
-
withBinaryVectors
public SearchParam.Builder withBinaryVectors(@Nonnull java.util.List<java.nio.ByteBuffer> binaryVectors)
Default to an emptyArrayList
. You can search either float or binary vectors, not both.- Parameters:
binaryVectors
- aList
of binary vectors to be queried. EachByteBuffer
object represents a binary vector, with every 8 bits constituting a byte.- Returns:
Builder
- See Also:
ByteBuffer
-
withPartitionTags
public SearchParam.Builder withPartitionTags(@Nonnull java.util.List<java.lang.String> partitionTags)
Optional. Search vectors with correspondingpartitionTags
. Default to an emptyList
- Parameters:
partitionTags
- aList
of partition tags- Returns:
Builder
-
withTopK
public SearchParam.Builder withTopK(long topK)
Optional. Limits search result totopK
. Default to 1024.- Parameters:
topK
- a topK number- Returns:
Builder
-
withParamsInJson
public SearchParam.Builder withParamsInJson(@Nonnull java.lang.String paramsInJson)
Optional. Default to emptyString
. Search parameters are different for different index types. Refer to https://milvus.io/docs/milvus_operation.md for more information.FLAT/IVFLAT/SQ8/IVFPQ: {"nprobe": 32} nprobe range:[1,999999] NSG: {"search_length": 100} search_length range:[10, 300] HNSW: {"ef": 64} ef range:[topk, 4096] ANNOY: {search_k", 0.05 * totalDataCount} search_k range: none
- Parameters:
paramsInJson
- extra parameters in JSON format- Returns:
Builder
-
build
public SearchParam build()
-
-