Package com.mongodb.client.model
Class SearchIndexModel
java.lang.Object
com.mongodb.client.model.SearchIndexModel
A model describing the creation of a single Atlas Search index.
- Since:
- 4.11
- Since server release
- 6.0
-
Constructor Summary
ConstructorsConstructorDescriptionSearchIndexModel
(String name, org.bson.conversions.Bson definition) Construct an instance with the given Atlas Search name and index definition.SearchIndexModel
(String name, org.bson.conversions.Bson definition, SearchIndexType type) Construct an instance with the given Atlas Search name, index definition, and type.SearchIndexModel
(org.bson.conversions.Bson definition) Construct an instance with the given Atlas Search index mapping definition. -
Method Summary
-
Constructor Details
-
SearchIndexModel
public SearchIndexModel(org.bson.conversions.Bson definition) Construct an instance with the given Atlas Search index mapping definition.After calling this constructor, the
name
field will benull
. In that case, when passing thisSearchIndexModel
to thecreateSearchIndexes
method, the default search index name 'default' will be used to create the search index.- Parameters:
definition
- the search index mapping definition.
-
SearchIndexModel
Construct an instance with the given Atlas Search name and index definition.- Parameters:
name
- the search index name.definition
- the search index mapping definition.
-
SearchIndexModel
public SearchIndexModel(@Nullable String name, org.bson.conversions.Bson definition, @Nullable SearchIndexType type) Construct an instance with the given Atlas Search name, index definition, and type.- Parameters:
name
- the search index name.definition
- the search index mapping definition.type
- the search index type.- Since:
- 5.2
-
-
Method Details
-
getDefinition
public org.bson.conversions.Bson getDefinition()Get the Atlas Search index mapping definition.- Returns:
- the index definition.
-
getName
Get the Atlas Search index name.- Returns:
- the search index name.
-
getType
Get the Atlas Search index type.- Returns:
- the search index type.
- Since:
- 5.2
-
toString
-