Package io.milvus.param.dml
Class SearchIteratorParam.Builder
- java.lang.Object
-
- io.milvus.param.dml.SearchIteratorParam.Builder
-
- Enclosing class:
- SearchIteratorParam
public static class SearchIteratorParam.Builder extends Object
Builder forSearchIteratorParamclass.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description SearchIteratorParam.BuilderaddOutField(String fieldName)Specifies an output field (Optional).SearchIteratorParam.BuilderaddPartitionName(String partitionName)Adds a partition to specify search scope (Optional).SearchIteratorParambuild()Verifies parameters and creates a newSearchIteratorParaminstance.SearchIteratorParam.BuilderwithBatchSize(@NotNull Long batchSize)Specify a value to control the number of entities returned per batch.SearchIteratorParam.BuilderwithBFloat16Vectors(List<ByteBuffer> vectors)Sets the target vectors to search on BFloat16Vector field.SearchIteratorParam.BuilderwithBinaryVectors(List<ByteBuffer> vectors)Sets the target vectors to search on BinaryVector field.SearchIteratorParam.BuilderwithCollectionName(String collectionName)Sets the collection name.SearchIteratorParam.BuilderwithConsistencyLevel(ConsistencyLevelEnum consistencyLevel)ConsistencyLevel of consistency level.SearchIteratorParam.BuilderwithDatabaseName(String databaseName)Sets the database name.SearchIteratorParam.BuilderwithExpr(String expr)Sets expression to filter out entities before searching (Optional).SearchIteratorParam.BuilderwithFloat16Vectors(List<ByteBuffer> vectors)Sets the target vectors to search on Float16Vector field.SearchIteratorParam.BuilderwithFloatVectors(List<List<Float>> vectors)Sets the target vectors to search on FloatVector field.SearchIteratorParam.BuilderwithGroupByFieldName(String groupByFieldName)Sets field name to do grouping.SearchIteratorParam.BuilderwithIgnoreGrowing(Boolean ignoreGrowing)Ignore the growing segments to get best search performance.SearchIteratorParam.BuilderwithLimit(Long limit)SearchIteratorParam.BuilderwithMetricType(MetricType metricType)Sets metric type of ANN searching.SearchIteratorParam.BuilderwithOutFields(List<String> outFields)Specifies output fields (Optional).SearchIteratorParam.BuilderwithParams(String params)Sets the search parameters specific to the index type.SearchIteratorParam.BuilderwithPartitionNames(List<String> partitionNames)Sets partition names list to specify search scope (Optional).SearchIteratorParam.BuilderwithRoundDecimal(Integer decimal)Specifies the decimal place of the returned results.SearchIteratorParam.BuilderwithSparseFloatVectors(List<SortedMap<Long,Float>> vectors)Sets the target vectors to search on SparseFloatVector field.SearchIteratorParam.BuilderwithTopK(Integer topK)Deprecated.SearchIteratorParam.BuilderwithVectorFieldName(String vectorFieldName)Sets target vector field by name.SearchIteratorParam.BuilderwithVectors(List<?> vectors)Deprecated.
-
-
-
Method Detail
-
withDatabaseName
public SearchIteratorParam.Builder withDatabaseName(String databaseName)
Sets the database name. database name can be nil.- Parameters:
databaseName- database name- Returns:
Builder
-
withCollectionName
public SearchIteratorParam.Builder withCollectionName(String collectionName)
Sets the collection name. Collection name cannot be empty or null.- Parameters:
collectionName- collection name- Returns:
Builder
-
withPartitionNames
public SearchIteratorParam.Builder withPartitionNames(List<String> partitionNames)
Sets partition names list to specify search scope (Optional).- Parameters:
partitionNames- partition names list- Returns:
Builder
-
withConsistencyLevel
public SearchIteratorParam.Builder withConsistencyLevel(ConsistencyLevelEnum consistencyLevel)
ConsistencyLevel of consistency level.- Parameters:
consistencyLevel- consistency level- Returns:
Builder
-
addPartitionName
public SearchIteratorParam.Builder addPartitionName(String partitionName)
Adds a partition to specify search scope (Optional).- Parameters:
partitionName- partition name- Returns:
Builder
-
withMetricType
public SearchIteratorParam.Builder withMetricType(MetricType metricType)
Sets metric type of ANN searching.- Parameters:
metricType- metric type- Returns:
Builder
-
withVectorFieldName
public SearchIteratorParam.Builder withVectorFieldName(String vectorFieldName)
Sets target vector field by name. Field name cannot be empty or null.- Parameters:
vectorFieldName- vector field name- Returns:
Builder
-
withTopK
@Deprecated public SearchIteratorParam.Builder withTopK(Integer topK)
Deprecated.Sets topK value of ANN search. withTopK() is deprecated, replaced by withLimit()- Parameters:
topK- topK value- Returns:
Builder
-
withLimit
public SearchIteratorParam.Builder withLimit(Long limit)
-
withExpr
public SearchIteratorParam.Builder withExpr(String expr)
Sets expression to filter out entities before searching (Optional).- Parameters:
expr- filtering expression- Returns:
Builder- See Also:
- Boolean Expression Rules
-
withOutFields
public SearchIteratorParam.Builder withOutFields(List<String> outFields)
Specifies output fields (Optional).- Parameters:
outFields- output fields- Returns:
Builder
-
addOutField
public SearchIteratorParam.Builder addOutField(String fieldName)
Specifies an output field (Optional).- Parameters:
fieldName- filed name- Returns:
Builder
-
withVectors
@Deprecated public SearchIteratorParam.Builder withVectors(List<?> vectors)
Deprecated.Sets the target vectors. Note: Deprecated in v2.4.0, for the reason that the sdk cannot know a ByteBuffer is a BinarVector or Float16Vector/BFloat16Vector. Replaced by withFloatVectors/withBinaryVectors/withFloat16Vectors/withBFloat16Vectors/withSparseFloatVectors. It still works for FloatVector/BinarVector/SparseVector, don't use it for Float16Vector/BFloat16Vector.- Parameters:
vectors- list of target vectors: if vector type is FloatVector, vectors is List of List Float; if vector type is BinaryVector, vectors is List of ByteBuffer; if vector type is SparseFloatVector, values is List of SortedMap[Long, Float];- Returns:
Builder
-
withFloatVectors
public SearchIteratorParam.Builder withFloatVectors(List<List<Float>> vectors)
Sets the target vectors to search on FloatVector field.- Parameters:
vectors- target vectors to search- Returns:
Builder
-
withBinaryVectors
public SearchIteratorParam.Builder withBinaryVectors(List<ByteBuffer> vectors)
Sets the target vectors to search on BinaryVector field.- Parameters:
vectors- target vectors to search- Returns:
Builder
-
withFloat16Vectors
public SearchIteratorParam.Builder withFloat16Vectors(List<ByteBuffer> vectors)
Sets the target vectors to search on Float16Vector field.- Parameters:
vectors- target vectors to search- Returns:
Builder
-
withBFloat16Vectors
public SearchIteratorParam.Builder withBFloat16Vectors(List<ByteBuffer> vectors)
Sets the target vectors to search on BFloat16Vector field.- Parameters:
vectors- target vectors to search- Returns:
Builder
-
withSparseFloatVectors
public SearchIteratorParam.Builder withSparseFloatVectors(List<SortedMap<Long,Float>> vectors)
Sets the target vectors to search on SparseFloatVector field.- Parameters:
vectors- target vectors to search- Returns:
Builder
-
withRoundDecimal
public SearchIteratorParam.Builder withRoundDecimal(Integer decimal)
Specifies the decimal place of the returned results.- Parameters:
decimal- how many digits after the decimal point- Returns:
Builder
-
withParams
public SearchIteratorParam.Builder withParams(String params)
Sets the search parameters specific to the index type.For example: IVF index, the search parameters can be "{\"nprobe\":10}" For more information: @see Index Selection
- Parameters:
params- extra parameters in json format- Returns:
Builder
-
withIgnoreGrowing
public SearchIteratorParam.Builder withIgnoreGrowing(Boolean ignoreGrowing)
Ignore the growing segments to get best search performance. Default is False. For the user case that don't require data visibility.- Parameters:
ignoreGrowing-Boolean.TRUEignore, Boolean.FALSE is not- Returns:
Builder
-
withGroupByFieldName
public SearchIteratorParam.Builder withGroupByFieldName(String groupByFieldName)
Sets field name to do grouping.- Parameters:
groupByFieldName- field name to do grouping- Returns:
Builder
-
withBatchSize
public SearchIteratorParam.Builder withBatchSize(@NotNull @NotNull Long batchSize)
Specify a value to control the number of entities returned per batch. Must be a positive value. Default value is 1000, will return without batchSize.- Parameters:
batchSize- a value to define the number of entities returned per batch- Returns:
Builder
-
build
public SearchIteratorParam build() throws ParamException
Verifies parameters and creates a newSearchIteratorParaminstance.- Returns:
SearchIteratorParam- Throws:
ParamException
-
-