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 SearchIndexType
Creates aSearchIndexType
from aBsonValue
in situations when there is no builder method that better satisfies your needs.static SearchIndexType
search()
Returns aSearchIndexType
instance representing the "search" index type.Converts this object toBsonValue
.static SearchIndexType
Returns aSearchIndexType
instance representing the "vectorSearch" index type.
-
Method Details
-
search
Returns aSearchIndexType
instance representing the "search" index type.- Returns:
- The requested
SearchIndexType
.
-
vectorSearch
Returns aSearchIndexType
instance representing the "vectorSearch" index type.- Returns:
- The requested
SearchIndexType
.
-
of
Creates aSearchIndexType
from aBsonValue
in 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 equivalentSearchIndexType
s, though they may not be equal.SearchIndexType type1 = SearchIndexType.vectorSearch(); SearchIndexType type2 = SearchIndexType.of(new BsonString("vectorSearch"));
- Parameters:
indexType
- ABsonValue
representing the requiredSearchIndexType
.- Returns:
- The requested
SearchIndexType
.
-
toBsonValue
BsonValue toBsonValue()Converts this object toBsonValue
.- Returns:
- A
BsonValue
representing thisSearchIndexType
.
-