Class SearchOptionsBuilder

java.lang.Object
com.hazelcast.vector.SearchOptionsBuilder

@Beta public class SearchOptionsBuilder extends Object
Vector search options builder
Since:
5.5
  • Constructor Details

    • SearchOptionsBuilder

      public SearchOptionsBuilder()
  • Method Details

    • includeValue

      public SearchOptionsBuilder includeValue()
      Includes the user-supplied value in search results.
      Returns:
      this builder instance
      See Also:
    • setIncludeValue

      public SearchOptionsBuilder setIncludeValue(boolean includeValue)
      Includes or excludes the user-supplied value in search results.
      Parameters:
      includeValue - true if search results should include the user-supplied value or false if only keys should be returned
      Returns:
      this builder instance
      See Also:
    • includeVectors

      public SearchOptionsBuilder includeVectors()
      Includes the vectors associated with each search result in search results.
      Returns:
      this builder instance
      See Also:
    • setIncludeVectors

      public SearchOptionsBuilder setIncludeVectors(boolean includeVectors)
      Includes or excludes the vectors associated with each search result in search results.
      Parameters:
      includeVectors - true if search results should include the vectors associated with each search result, false otherwise
      Returns:
      this builder instance
      See Also:
    • limit

      public SearchOptionsBuilder limit(int limit)
      Sets the number of search results to return.
      Parameters:
      limit - the number of search results to return. Must be positive.
      Returns:
      this builder instance
      See Also:
    • hint

      public <T> SearchOptionsBuilder hint(String hintName, T value)
      Adds search hint. Hints allow fine-tuning of the query execution.
      Type Parameters:
      T - type of hint value
      Parameters:
      hintName - name of the hint
      value - value of the hint
      Returns:
      this builder instance
      See Also:
    • hint

      public <T> SearchOptionsBuilder hint(Hint<T> hint, T value)
      Adds search hint. Hints allow fine-tuning of the query execution.
      Type Parameters:
      T - type of hint value
      Parameters:
      hint - hint definition
      value - value of the hint
      Returns:
      this builder instance
      See Also:
    • hints

      public SearchOptionsBuilder hints(Map<String,String> hints)
      Sets search hints. Hints allow fine-tuning of the query execution.
      Parameters:
      hints - map of hint names and values
      Returns:
      this builder instance
      See Also:
    • build

      public SearchOptions build()
      Returns:
      SearchOptions instance