Package io.milvus.param.index
Class CreateIndexParam.Builder
java.lang.Object
io.milvus.param.index.CreateIndexParam.Builder
- Enclosing class:
CreateIndexParam
Builder for
CreateIndexParam class.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Verifies parameters and creates a newCreateIndexParaminstance.withCollectionName(@NonNull String collectionName) Set the collection name.withDatabaseName(String databaseName) Sets the database name.withExtraParam(@NonNull String extraParam) Sets the specific index parameters according to index type.withFieldName(@NonNull String fieldName) Sets the target field name.withIndexName(@NonNull String indexName) The name of index which will be created.withIndexType(@NonNull IndexType indexType) Sets the index type.withMetricType(@NonNull MetricType metricType) Sets the metric type.withSyncMode(@NonNull Boolean syncMode) Enables to sync mode.withSyncWaitingInterval(@NonNull Long milliseconds) Sets the waiting interval in sync mode.withSyncWaitingTimeout(@NonNull Long seconds) Sets the timeout value for sync mode.
-
Method Details
-
withDatabaseName
Sets the database name. database name can be nil.- Parameters:
databaseName- database name- Returns:
Builder
-
withCollectionName
Set the collection name. Collection name cannot be empty or null.- Parameters:
collectionName- collection name- Returns:
Builder
-
withFieldName
Sets the target field name. Field name cannot be empty or null.- Parameters:
fieldName- field name- Returns:
Builder
-
withIndexType
Sets the index type.- Parameters:
indexType- index type- Returns:
Builder
-
withIndexName
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
Sets the metric type.- Parameters:
metricType- metric type- Returns:
Builder
-
withExtraParam
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
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
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:
-
withSyncWaitingTimeout
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:
-
build
Verifies parameters and creates a newCreateIndexParaminstance.- Returns:
CreateIndexParam- Throws:
ParamException
-