Interface SearchIndexType


@Sealed public 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 Details

    • search

      static SearchIndexType search()
      Returns a SearchIndexType instance representing the "search" index type.
      Returns:
      The requested SearchIndexType.
    • vectorSearch

      static SearchIndexType vectorSearch()
      Returns a SearchIndexType instance representing the "vectorSearch" index type.
      Returns:
      The requested SearchIndexType.
    • of

      static SearchIndexType of(org.bson.BsonValue indexType)
      Creates a SearchIndexType from a BsonValue 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 equivalent SearchIndexTypes, though they may not be equal.

      
        SearchIndexType type1 = SearchIndexType.vectorSearch();
        SearchIndexType type2 = SearchIndexType.of(new BsonString("vectorSearch"));
       
      Parameters:
      indexType - A BsonValue representing the required SearchIndexType.
      Returns:
      The requested SearchIndexType.
    • toBsonValue

      org.bson.BsonValue toBsonValue()
      Converts this object to BsonValue.
      Returns:
      A BsonValue representing this SearchIndexType.