Class IndexOptions

java.lang.Object
redis.clients.jedis.search.IndexOptions
All Implemented Interfaces:
IParams

public class IndexOptions extends Object implements IParams
IndexOptions encapsulates flags for index creation and should be given to the client on index creation
Since:
2.0
  • Field Details

    • USE_TERM_OFFSETS

      public static final int USE_TERM_OFFSETS
      Set this to tell the index not to save term offset vectors. This reduces memory consumption but does not allow performing exact matches, and reduces overall relevance of multi-term queries
      See Also:
    • KEEP_FIELD_FLAGS

      public static final int KEEP_FIELD_FLAGS
      If set (default), we keep flags per index record telling us what fields the term appeared on, and allowing us to filter results by field
      See Also:
    • KEEP_TERM_FREQUENCIES

      public static final int KEEP_TERM_FREQUENCIES
      With each document:term record, store how often the term appears within the document. This can be used for sorting documents by their relevance to the given term.
      See Also:
    • DEFAULT_FLAGS

      public static final int DEFAULT_FLAGS
      See Also:
    • flags

      private final int flags
    • stopwords

      private List<String> stopwords
    • expire

      private long expire
    • definition

      private IndexDefinition definition
  • Constructor Details

    • IndexOptions

      public IndexOptions(int flags)
      Default constructor
      Parameters:
      flags - flag mask
  • Method Details

    • defaultOptions

      public static IndexOptions defaultOptions()
      The default indexing options - use term offsets and keep fields flags
    • setStopwords

      public IndexOptions setStopwords(String... stopwords)
      Set a custom stopword list
      Parameters:
      stopwords - the list of stopwords
      Returns:
      the options object itself, for builder-style construction
    • setNoStopwords

      public IndexOptions setNoStopwords()
      Set the index to contain no stopwords, overriding the default list
      Returns:
      the options object itself, for builder-style constructions
    • setTemporary

      public IndexOptions setTemporary(long expire)
      Temporary
      Parameters:
      expire -
      Returns:
      IndexOptions
    • getDefinition

      public IndexDefinition getDefinition()
    • setDefinition

      public IndexOptions setDefinition(IndexDefinition definition)
    • addParams

      public void addParams(CommandArguments args)
      Specified by:
      addParams in interface IParams