milvus-logo
Star
0
Forks
0
Get Started

Class CreateIndexParam.Builder

  • java.lang.Object
    • io.milvus.param.index.CreateIndexParam.Builder
    • 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