Package io.milvus.param.index
Class CreateIndexParam.Builder
- java.lang.Object
-
- io.milvus.param.index.CreateIndexParam.Builder
-
- Enclosing class:
- CreateIndexParam
public static final class CreateIndexParam.Builder extends Object
Builder forCreateIndexParamclass.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CreateIndexParambuild()Verifies parameters and creates a newCreateIndexParaminstance.CreateIndexParam.BuilderwithCollectionName(@NonNull String collectionName)Set the collection name.CreateIndexParam.BuilderwithDatabaseName(String databaseName)Sets the database name.CreateIndexParam.BuilderwithExtraParam(@NonNull String extraParam)Sets the specific index parameters according to index type.CreateIndexParam.BuilderwithFieldName(@NonNull String fieldName)Sets the target field name.CreateIndexParam.BuilderwithIndexName(@NonNull String indexName)The name of index which will be created.CreateIndexParam.BuilderwithIndexType(@NonNull IndexType indexType)Sets the index type.CreateIndexParam.BuilderwithMetricType(@NonNull MetricType metricType)Sets the metric type.CreateIndexParam.BuilderwithSyncMode(@NonNull Boolean syncMode)Enables to sync mode.CreateIndexParam.BuilderwithSyncWaitingInterval(@NonNull Long milliseconds)Sets the waiting interval in sync mode.CreateIndexParam.BuilderwithSyncWaitingTimeout(@NonNull Long seconds)Sets the timeout value for sync mode.
-
-
-
Method Detail
-
withDatabaseName
public CreateIndexParam.Builder withDatabaseName(String databaseName)
Sets the database name. database name can be nil.- Parameters:
databaseName- database name- Returns:
Builder
-
withCollectionName
public CreateIndexParam.Builder withCollectionName(@NonNull @NonNull String collectionName)
Set the collection name. Collection name cannot be empty or null.- Parameters:
collectionName- collection name- Returns:
Builder
-
withFieldName
public CreateIndexParam.Builder withFieldName(@NonNull @NonNull String fieldName)
Sets the target field name. Field name cannot be empty or null.- Parameters:
fieldName- field name- Returns:
Builder
-
withIndexType
public CreateIndexParam.Builder withIndexType(@NonNull @NonNull IndexType indexType)
Sets the index type.- Parameters:
indexType- index type- Returns:
Builder
-
withIndexName
public CreateIndexParam.Builder withIndexName(@NonNull @NonNull String indexName)
The name of index which will be created. Then you can use the index name to check the state of index. If no index name is specified, the default index name("_default_idx") is used.- Parameters:
indexName- index name- Returns:
Builder
-
withMetricType
public CreateIndexParam.Builder withMetricType(@NonNull @NonNull MetricType metricType)
Sets the metric type.- Parameters:
metricType- metric type- Returns:
Builder
-
withExtraParam
public CreateIndexParam.Builder withExtraParam(@NonNull @NonNull String extraParam)
Sets the specific index parameters according to index type. For example: IVF index, the extra parameters can be "{\"nlist\":1024}". For more information: @see Index Selection- Parameters:
extraParam- extra parameters in .json format- Returns:
Builder
-
withSyncMode
public CreateIndexParam.Builder withSyncMode(@NonNull @NonNull Boolean syncMode)
Enables to sync mode. With sync mode enabled, the client keeps waiting until all segments of the collection are successfully indexed. With sync mode disabled, client returns at once after the createIndex() is called.- Parameters:
syncMode-Boolean.TRUEis sync mode, Boolean.FALSE is not- Returns:
Builder
-
withSyncWaitingInterval
public CreateIndexParam.Builder withSyncWaitingInterval(@NonNull @NonNull Long milliseconds)
Sets the waiting interval in sync mode. With sync mode enabled, the client constantly checks index state by interval. Interval must be greater than zero, and cannot be greater than Constant.MAX_WAITING_INDEX_INTERVAL. Default value is 500 milliseconds.- Parameters:
milliseconds- interval- Returns:
Builder- See Also:
Constant
-
withSyncWaitingTimeout
public CreateIndexParam.Builder withSyncWaitingTimeout(@NonNull @NonNull Long seconds)
Sets the timeout value for sync mode. Timeout value must be greater than zero and with No upper limit. Default value is 600 seconds.- Parameters:
seconds- time out value for sync mode- Returns:
Builder- See Also:
Constant
-
build
public CreateIndexParam build() throws ParamException
Verifies parameters and creates a newCreateIndexParaminstance.- Returns:
CreateIndexParam- Throws:
ParamException
-
-