Package com.mongodb.client.model
Interface SearchIndexType
This interface represents an Atlas Search Index type, which is utilized for creating specific types of indexes.
It provides methods for creating and converting Atlas Search Index types to BsonValue.
- Since:
- 5.2
- See Also:
- Since server release
- 6.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic SearchIndexTypeCreates aSearchIndexTypefrom aBsonValuein situations when there is no builder method that better satisfies your needs.static SearchIndexTypesearch()Returns aSearchIndexTypeinstance representing the "search" index type.Converts this object toBsonValue.static SearchIndexTypeReturns aSearchIndexTypeinstance representing the "vectorSearch" index type.
-
Method Details
-
search
Returns aSearchIndexTypeinstance representing the "search" index type.- Returns:
- The requested
SearchIndexType.
-
vectorSearch
Returns aSearchIndexTypeinstance representing the "vectorSearch" index type.- Returns:
- The requested
SearchIndexType.
-
of
Creates aSearchIndexTypefrom aBsonValuein situations when there is no builder method that better satisfies your needs. This method cannot be used to validate the syntax.Example
The following code creates two functionally equivalentSearchIndexTypes, though they may not be equal.SearchIndexType type1 = SearchIndexType.vectorSearch(); SearchIndexType type2 = SearchIndexType.of(new BsonString("vectorSearch"));- Parameters:
indexType- ABsonValuerepresenting the requiredSearchIndexType.- Returns:
- The requested
SearchIndexType.
-
toBsonValue
BsonValue toBsonValue()Converts this object toBsonValue.- Returns:
- A
BsonValuerepresenting thisSearchIndexType.
-