Class Index.Builder

  • Enclosing class:
    Index

    public static class Index.Builder
    extends java.lang.Object
    Builder for Index
    • Constructor Summary

      Constructors 
      Constructor Description
      Builder​(java.lang.String collectionName, IndexType indexType)  
    • Constructor Detail

      • Builder

        public Builder​(@Nonnull
                       java.lang.String collectionName,
                       @Nonnull
                       IndexType indexType)
        Parameters:
        collectionName - collection to create index on
        indexType - a IndexType object
    • Method Detail

      • withParamsInJson

        public Index.Builder withParamsInJson​(@Nonnull
                                              java.lang.String paramsInJson)
        Optional. Default to empty String. Index parameters are different for different index types. Refer to https://milvus.io/docs/milvus_operation.md for more information.
         FLAT/IVFLAT/SQ8: {"nlist": 16384}
         nlist range:[1, 999999]
        
         IVFPQ: {"nlist": 16384, "m": 12}
         nlist range:[1, 999999]
         m is decided by dim and have a couple of results.
        
         NSG: {"search_length": 45, "out_degree": 50, "candidate_pool_size": 300, "knng": 100}
         search_length range:[10, 300]
         out_degree range:[5, 300]
         candidate_pool_size range:[50, 1000]
         knng range:[5, 300]
        
         HNSW: {"M": 16, "efConstruction": 500}
         M range:[5, 48]
         efConstruction range:[100, 500]
        
         ANNOY: {"n_trees": 4}
         n_trees range: [1, 16384)
         
        Parameters:
        paramsInJson - extra parameters in JSON format
        Returns:
        Builder
      • build

        public Index build()