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.
The definition parameter accepts any Bson instance.
For vector search indexes, use the builders provided by SearchIndexDefinition.vectorSearch(Bson...)
and VectorSearchIndexFields to construct the definition, and pass it to the
vector search constructor
which automatically sets the index type to SearchIndexType.vectorSearch().
- Since:
- 4.11
- See Also:
- Since server release
- 6.0
-
Constructor Summary
ConstructorsConstructorDescriptionSearchIndexModel(String name, VectorSearchIndexDefinition definition) Construct a vector search index instance with the given name and definition.SearchIndexModel(String name, Bson definition) Construct an instance with the given Atlas Search name and index definition.SearchIndexModel(String name, Bson definition, SearchIndexType type) Construct an instance with the given Atlas Search name, index definition, and type.SearchIndexModel(Bson definition) Construct an instance with the given Atlas Search index mapping definition. -
Method Summary
-
Constructor Details
-
SearchIndexModel
Construct an instance with the given Atlas Search index mapping definition.After calling this constructor, the
namefield will benull. In that case, when passing thisSearchIndexModelto thecreateSearchIndexesmethod, the default search index name 'default' will be used to create the search index.- Parameters:
definition- the search index mapping definition.- See Also:
-
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.- See Also:
-
SearchIndexModel
Construct a vector search index instance with the given name and definition.The index type is automatically set to
SearchIndexType.vectorSearch().- Parameters:
name- the search index name.definition- the vector search index definition.- Since:
- 5.8
- See Also:
-
SearchIndexModel
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
- See Also:
-
-
Method Details