Class LuceneIndexOptions

java.lang.Object
com.apple.foundationdb.record.lucene.LuceneIndexOptions

@API(EXPERIMENTAL) public class LuceneIndexOptions extends Object
Options for use with Lucene indexes.
  • Field Details

    • DELIMITER_BETWEEN_KEY_AND_VALUE

      public static final String DELIMITER_BETWEEN_KEY_AND_VALUE
      The delimiter by which the key and value of one key-value pair within the option's value is split.
      See Also:
    • DELIMITER_BETWEEN_ELEMENTS

      public static final String DELIMITER_BETWEEN_ELEMENTS
      The delimiter by which the elements are split if the option's value has multiple elements or key-value pairs.
      See Also:
    • NGRAM_TOKEN_EDGES_ONLY

      public static final String NGRAM_TOKEN_EDGES_ONLY
      Whether a Lucene's EdgeNGramTokenFilter or a regular NGramTokenFilter to use for the ngram analyzer.
      See Also:
    • LUCENE_ANALYZER_NAME_OPTION

      public static final String LUCENE_ANALYZER_NAME_OPTION
      The name of the Lucene analyzer to use for full-text search.
      See Also:
    • LUCENE_ANALYZER_NAME_PER_FIELD_OPTION

      public static final String LUCENE_ANALYZER_NAME_PER_FIELD_OPTION
      The override mapping from fields to Lucene analyzers, if they want to use different analyzer than the default one. The format of the value should be "fieldName1:analyzerName1,fieldName2:analyzerName2...", with key-value pairs split by "," and each key and value split by ":".
      See Also:
    • AUTO_COMPLETE_ANALYZER_NAME_OPTION

      public static final String AUTO_COMPLETE_ANALYZER_NAME_OPTION
      The name of the Lucene analyzer to use for auto-complete query.
      See Also:
    • AUTO_COMPLETE_ANALYZER_NAME_PER_FIELD_OPTION

      public static final String AUTO_COMPLETE_ANALYZER_NAME_PER_FIELD_OPTION
      The override mapping from fields to Lucene analyzers for auto-complete query, if they want to use different analyzers than the default one. The format of the value should be "fieldName1:analyzerName1,fieldName2:analyzerName2...", with key-value pairs split by "," and each key and value split by ":".
      See Also:
    • TEXT_SYNONYM_SET_NAME_OPTION

      public static final String TEXT_SYNONYM_SET_NAME_OPTION
      The name of the synonym set to use in Lucene.
      See Also:
    • PRIMARY_KEY_SERIALIZATION_FORMAT

      public static final String PRIMARY_KEY_SERIALIZATION_FORMAT
      See Also:
    • PRIMARY_KEY_SEGMENT_INDEX_ENABLED

      public static final String PRIMARY_KEY_SEGMENT_INDEX_ENABLED
      Whether a separate B-tree index gives a direct mapping of live documents to segment by record primary key. Boolean string (true or false).
      See Also:
    • OPTIMIZED_STORED_FIELDS_FORMAT_ENABLED

      public static final String OPTIMIZED_STORED_FIELDS_FORMAT_ENABLED
      Whether to use the StoredFields format that stores data in K/V (TRUE) pairs or in the standard Lucene file (FALSE).
      See Also:
    • INDEX_PARTITION_BY_FIELD_NAME

      public static final String INDEX_PARTITION_BY_FIELD_NAME
      Option to designate a record field as the timestamp by which the corresponding document would be partitioned in Lucene.
      See Also:
    • INDEX_PARTITION_HIGH_WATERMARK

      public static final String INDEX_PARTITION_HIGH_WATERMARK
      Option to set high watermark size for a lucene partition, beyond which the partition would be split, or a new partition would be created.
      See Also:
    • INDEX_PARTITION_LOW_WATERMARK

      public static final String INDEX_PARTITION_LOW_WATERMARK
      Option to set low watermark size for a lucene partition, below which the partition would be a candidate for merge with another adjacent partition.
      See Also:
    • PRIMARY_KEY_SEGMENT_INDEX_V2_ENABLED

      public static final String PRIMARY_KEY_SEGMENT_INDEX_V2_ENABLED
      Whether a separate B-tree index gives a direct mapping of live documents to segment by record primary key, that utilizes an optimized stored fields to manage merges.

      Boolean string (true or false).

      This is incompatible with PRIMARY_KEY_SEGMENT_INDEX_ENABLED, and thus only one can be enabled on an index. This implies OPTIMIZED_STORED_FIELDS_FORMAT_ENABLED, and thus OPTIMIZED_STORED_FIELDS_FORMAT_ENABLED cannot be set (to true or false) if this is enabled.

      See Also:
    • ENABLE_PENDING_WRITE_QUEUE_DURING_MERGE

      public static final String ENABLE_PENDING_WRITE_QUEUE_DURING_MERGE
      Enable pending write queue during an ongoing merge. During an ongoing merge the index is locked, which causes record updates attempts to fail. When this option is set to true, record updates during merge will be written to a queue and applied when the merge is done. When such queue exists, queries on the index will first apply the items in the pending queue (without commiting), which will keep consistency.
      See Also:
  • Method Details

    • parseKeyValuePairOptionValue

      public static Map<String,String> parseKeyValuePairOptionValue(@Nonnull String optionValue)
      Parse an option's value to a key-value map.
      Parameters:
      optionValue - the raw string for option's value
      Returns:
      the map
    • parseMultipleElementsOptionValue

      public static Set<String> parseMultipleElementsOptionValue(@Nonnull String optionValue)
      Parse an option's value to a set of strings.
      Parameters:
      optionValue - the raw string for option's value
      Returns:
      map
    • validateKeyValuePairOptionValue

      public static void validateKeyValuePairOptionValue(@Nonnull String optionValue, @Nonnull RecordCoreException exceptionToThrow)
      Validate the raw string for an option's value has valid format for a key-value map.
      Parameters:
      optionValue - the raw string for option's value
      exceptionToThrow - the exception to throw if it is invalid
    • validateMultipleElementsOptionValue

      public static void validateMultipleElementsOptionValue(@Nonnull String optionValue, @Nonnull RecordCoreException exceptionToThrow)
      Validate the raw string for an option's value has valid format for multiple-elements.
      Parameters:
      optionValue - the raw string for option's value
      exceptionToThrow - the exception to throw if it is invalid