Class SearchIndexModel

java.lang.Object
com.mongodb.client.model.SearchIndexModel

public final class SearchIndexModel extends Object
A model describing the creation of a single Atlas Search index.
Since:
4.11
Since server release
7.0
  • Constructor Details

    • SearchIndexModel

      public SearchIndexModel(Bson definition)
      Construct an instance with the given Atlas Search index mapping definition.

      After calling this constructor, the name field will be null. In that case, when passing this SearchIndexModel to the createSearchIndexes method, the default search index name 'default' will be used to create the search index.

      Parameters:
      definition - the search index mapping definition.
    • SearchIndexModel

      public SearchIndexModel(String name, Bson definition)
      Construct an instance with the given Atlas Search name and index definition.
      Parameters:
      name - the search index name.
      definition - the search index mapping definition.
  • Method Details

    • getDefinition

      public Bson getDefinition()
      Get the Atlas Search index mapping definition.
      Returns:
      the index definition.
    • getName

      @Nullable public String getName()
      Get the Atlas Search index name.
      Returns:
      the search index name.
    • toString

      public String toString()
      Overrides:
      toString in class Object