Class CreateIndexParam.Builder
- java.lang.Object
-
- io.milvus.param.index.CreateIndexParam.Builder
-
- Enclosing class:
- CreateIndexParam
public static final class CreateIndexParam.Builder extends java.lang.Object
Builder forCreateIndexParam
class.
-
-
Method Summary
Modifier and Type Method Description CreateIndexParam
build()
Verifies parameters and creates a newCreateIndexParam
instance.CreateIndexParam.Builder
withCollectionName(@NonNull java.lang.String collectionName)
Set the collection name.CreateIndexParam.Builder
withExtraParam(@NonNull java.lang.String extraParam)
Sets the specific index parameters according to index type.CreateIndexParam.Builder
withFieldName(@NonNull java.lang.String fieldName)
Sets the target field name.CreateIndexParam.Builder
withIndexType(@NonNull IndexType indexType)
Sets the index type.CreateIndexParam.Builder
withMetricType(@NonNull MetricType metricType)
Sets the metric type.CreateIndexParam.Builder
withSyncMode(@NonNull java.lang.Boolean syncMode)
Enables to sync mode.CreateIndexParam.Builder
withSyncWaitingInterval(@NonNull java.lang.Long milliseconds)
Sets the waiting interval in sync mode.CreateIndexParam.Builder
withSyncWaitingTimeout(@NonNull java.lang.Long seconds)
Sets the timeout value for sync mode.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Method Detail
-
withCollectionName
public CreateIndexParam.Builder withCollectionName(@NonNull @NonNull java.lang.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 java.lang.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
-
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 java.lang.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 java.lang.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.TRUE
is sync mode, Boolean.FALSE is not- Returns:
Builder
-
withSyncWaitingInterval
public CreateIndexParam.Builder withSyncWaitingInterval(@NonNull @NonNull java.lang.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.- Parameters:
milliseconds
- interval- Returns:
Builder
- See Also:
Constant
-
withSyncWaitingTimeout
public CreateIndexParam.Builder withSyncWaitingTimeout(@NonNull @NonNull java.lang.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.- Parameters:
seconds
- time out value for sync mode- Returns:
Builder
- See Also:
Constant
-
build
public CreateIndexParam build() throws ParamException
Verifies parameters and creates a newCreateIndexParam
instance.- Returns:
CreateIndexParam
- Throws:
ParamException
-
-