Record Class IndicesOptions

java.lang.Object
java.lang.Record
org.elasticsearch.action.support.IndicesOptions
Record Components:
concreteTargetOptions - , applies only to concrete targets and defines how the response will handle when a concrete target does not exist.
wildcardOptions - , applies only to wildcard expressions and defines how the wildcards will be expanded and if it will be acceptable to have expressions that results to no indices.
gatekeeperOptions - , applies to all the resolved indices and defines if throttled will be included and if certain type of aliases or indices are allowed, or they will throw an error. It acts as a gatekeeper when an action does not support certain options.
failureStoreOptions - , applies to all indices already matched and controls the type of indices that will be returned. Currently, there are two types, data stream failure indices (only certain data streams have them) and data stream backing indices or stand-alone indices.
All Implemented Interfaces:
ToXContent, ToXContentFragment

public record IndicesOptions(IndicesOptions.ConcreteTargetOptions concreteTargetOptions, IndicesOptions.WildcardOptions wildcardOptions, IndicesOptions.GatekeeperOptions gatekeeperOptions, IndicesOptions.FailureStoreOptions failureStoreOptions) extends Record implements ToXContentFragment
Contains all the multi-target syntax options. These options are split into groups depending on what aspect of the syntax they influence.
  • Field Details

    • DEFAULT

      public static final IndicesOptions DEFAULT
    • STRICT_EXPAND_OPEN

      public static final IndicesOptions STRICT_EXPAND_OPEN
    • STRICT_EXPAND_OPEN_FAILURE_STORE

      public static final IndicesOptions STRICT_EXPAND_OPEN_FAILURE_STORE
    • LENIENT_EXPAND_OPEN

      public static final IndicesOptions LENIENT_EXPAND_OPEN
    • LENIENT_EXPAND_OPEN_HIDDEN

      public static final IndicesOptions LENIENT_EXPAND_OPEN_HIDDEN
    • LENIENT_EXPAND_OPEN_CLOSED

      public static final IndicesOptions LENIENT_EXPAND_OPEN_CLOSED
    • LENIENT_EXPAND_OPEN_CLOSED_HIDDEN

      public static final IndicesOptions LENIENT_EXPAND_OPEN_CLOSED_HIDDEN
    • STRICT_EXPAND_OPEN_CLOSED

      public static final IndicesOptions STRICT_EXPAND_OPEN_CLOSED
    • STRICT_EXPAND_OPEN_CLOSED_HIDDEN

      public static final IndicesOptions STRICT_EXPAND_OPEN_CLOSED_HIDDEN
    • LENIENT_EXPAND_OPEN_CLOSED_FAILURE_STORE

      public static final IndicesOptions LENIENT_EXPAND_OPEN_CLOSED_FAILURE_STORE
    • STRICT_EXPAND_OPEN_CLOSED_HIDDEN_FAILURE_STORE

      public static final IndicesOptions STRICT_EXPAND_OPEN_CLOSED_HIDDEN_FAILURE_STORE
    • STRICT_EXPAND_OPEN_CLOSED_FAILURE_STORE

      public static final IndicesOptions STRICT_EXPAND_OPEN_CLOSED_FAILURE_STORE
    • STRICT_EXPAND_OPEN_FORBID_CLOSED

      public static final IndicesOptions STRICT_EXPAND_OPEN_FORBID_CLOSED
    • STRICT_EXPAND_OPEN_HIDDEN_FORBID_CLOSED

      public static final IndicesOptions STRICT_EXPAND_OPEN_HIDDEN_FORBID_CLOSED
    • STRICT_EXPAND_OPEN_FORBID_CLOSED_IGNORE_THROTTLED

      public static final IndicesOptions STRICT_EXPAND_OPEN_FORBID_CLOSED_IGNORE_THROTTLED
    • STRICT_SINGLE_INDEX_NO_EXPAND_FORBID_CLOSED

      public static final IndicesOptions STRICT_SINGLE_INDEX_NO_EXPAND_FORBID_CLOSED
    • STRICT_NO_EXPAND_FORBID_CLOSED

      public static final IndicesOptions STRICT_NO_EXPAND_FORBID_CLOSED
  • Constructor Details

  • Method Details

    • builder

      public static IndicesOptions.Builder builder()
    • builder

      public static IndicesOptions.Builder builder(IndicesOptions indicesOptions)
    • ignoreUnavailable

      public boolean ignoreUnavailable()
      Returns:
      Whether specified concrete indices should be ignored when unavailable (missing or closed)
    • allowNoIndices

      public boolean allowNoIndices()
      Returns:
      Whether to ignore if a wildcard expression resolves to no concrete indices. The `_all` string or empty list of indices count as wildcard expressions too. Also when an alias points to a closed index this option decides if no concrete indices are allowed.
    • expandWildcardsOpen

      public boolean expandWildcardsOpen()
      Returns:
      Whether wildcard expressions should get expanded to open indices
    • expandWildcardsClosed

      public boolean expandWildcardsClosed()
      Returns:
      Whether wildcard expressions should get expanded to closed indices
    • expandWildcardExpressions

      public boolean expandWildcardExpressions()
      Returns:
      whether wildcard expression should get expanded
    • expandWildcardsHidden

      public boolean expandWildcardsHidden()
      Returns:
      Whether wildcard expressions should get expanded to hidden indices
    • forbidClosedIndices

      public boolean forbidClosedIndices()
      Returns:
      Whether execution on closed indices is allowed.
    • allowFailureIndices

      public boolean allowFailureIndices()
      Returns:
      Whether execution on closed indices is allowed.
    • allowAliasesToMultipleIndices

      public boolean allowAliasesToMultipleIndices()
      Returns:
      whether aliases pointing to multiple indices are allowed
    • ignoreAliases

      public boolean ignoreAliases()
      Returns:
      whether aliases should be ignored (when resolving a wildcard)
    • ignoreThrottled

      public boolean ignoreThrottled()
      Returns:
      whether indices that are marked as throttled should be ignored
    • includeRegularIndices

      public boolean includeRegularIndices()
      Returns:
      whether regular indices (stand-alone or backing indices) will be included in the response
    • includeFailureIndices

      public boolean includeFailureIndices()
      Returns:
      whether failure indices (only supported by certain data streams) will be included in the response
    • writeIndicesOptions

      public void writeIndicesOptions(StreamOutput out) throws IOException
      Throws:
      IOException
    • readIndicesOptions

      public static IndicesOptions readIndicesOptions(StreamInput in) throws IOException
      Throws:
      IOException
    • fromOptions

      public static IndicesOptions fromOptions(boolean ignoreUnavailable, boolean allowNoIndices, boolean expandToOpenIndices, boolean expandToClosedIndices)
    • fromOptions

      public static IndicesOptions fromOptions(boolean ignoreUnavailable, boolean allowNoIndices, boolean expandToOpenIndices, boolean expandToClosedIndices, boolean expandToHiddenIndices)
    • fromOptions

      public static IndicesOptions fromOptions(boolean ignoreUnavailable, boolean allowNoIndices, boolean expandToOpenIndices, boolean expandToClosedIndices, IndicesOptions defaultOptions)
    • fromOptions

      public static IndicesOptions fromOptions(boolean ignoreUnavailable, boolean allowNoIndices, boolean expandToOpenIndices, boolean expandToClosedIndices, boolean allowAliasesToMultipleIndices, boolean forbidClosedIndices, boolean ignoreAliases, boolean ignoreThrottled)
    • fromOptions

      public static IndicesOptions fromOptions(boolean ignoreUnavailable, boolean allowNoIndices, boolean expandToOpenIndices, boolean expandToClosedIndices, boolean expandToHiddenIndices, boolean allowAliasesToMultipleIndices, boolean forbidClosedIndices, boolean ignoreAliases, boolean ignoreThrottled)
    • fromRequest

      public static IndicesOptions fromRequest(RestRequest request, IndicesOptions defaultSettings)
    • fromMap

      public static IndicesOptions fromMap(Map<String,Object> map, IndicesOptions defaultSettings)
    • isIndicesOptions

      public static boolean isIndicesOptions(String name)
      Returns true if the name represents a valid name for one of the indices option false otherwise
    • fromParameters

      public static IndicesOptions fromParameters(Object wildcardsString, Object ignoreUnavailableString, Object allowNoIndicesString, Object ignoreThrottled, IndicesOptions defaultSettings)
    • fromParameters

      public static IndicesOptions fromParameters(Object wildcardsString, Object ignoreUnavailableString, Object allowNoIndicesString, Object ignoreThrottled, Object failureStoreString, IndicesOptions defaultSettings)
    • toXContent

      public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface ToXContent
      Throws:
      IOException
    • fromXContent

      public static IndicesOptions fromXContent(XContentParser parser) throws IOException
      Throws:
      IOException
    • fromXContent

      public static IndicesOptions fromXContent(XContentParser parser, @Nullable IndicesOptions defaults) throws IOException
      Throws:
      IOException
    • strictExpandOpen

      public static IndicesOptions strictExpandOpen()
      Returns:
      indices options that requires every specified index to exist, expands wildcards only to open indices and allows that no indices are resolved from wildcard expressions (not returning an error).
    • strictExpandOpenIncludeFailureStore

      public static IndicesOptions strictExpandOpenIncludeFailureStore()
      Returns:
      indices options that requires every specified index to exist, expands wildcards only to open indices and allows that no indices are resolved from wildcard expressions (not returning an error).
    • strictExpandOpenAndForbidClosed

      public static IndicesOptions strictExpandOpenAndForbidClosed()
      Returns:
      indices options that requires every specified index to exist, expands wildcards only to open indices, allows that no indices are resolved from wildcard expressions (not returning an error) and forbids the use of closed indices by throwing an error.
    • strictExpandOpenAndForbidClosedIgnoreThrottled

      public static IndicesOptions strictExpandOpenAndForbidClosedIgnoreThrottled()
      Returns:
      indices options that requires every specified index to exist, expands wildcards only to open indices, allows that no indices are resolved from wildcard expressions (not returning an error), forbids the use of closed indices by throwing an error and ignores indices that are throttled.
    • strictExpand

      public static IndicesOptions strictExpand()
      Returns:
      indices option that requires every specified index to exist, expands wildcards to both open and closed indices and allows that no indices are resolved from wildcard expressions (not returning an error).
    • strictExpandHidden

      public static IndicesOptions strictExpandHidden()
      Returns:
      indices option that requires every specified index to exist, expands wildcards to both open and closed indices, includes hidden indices, and allows that no indices are resolved from wildcard expressions (not returning an error).
    • lenientExpandIncludeFailureStore

      public static IndicesOptions lenientExpandIncludeFailureStore()
      Returns:
      indices option that expands wildcards to both open and closed indices, includes failure store (with data stream) and allows that indices can be missing and no indices are resolved from wildcard expressions (not returning an error).
    • strictExpandHiddenIncludeFailureStore

      public static IndicesOptions strictExpandHiddenIncludeFailureStore()
      Returns:
      indices option that requires every specified index to exist, expands wildcards to both open and closed indices, includes hidden indices, includes failure store (with data stream) and allows that no indices are resolved from wildcard expressions (not returning an error).
    • strictNoExpandForbidClosed

      public static IndicesOptions strictNoExpandForbidClosed()
      Returns:
      indices option that requires each specified index or alias to exist, doesn't expand wildcards.
    • strictSingleIndexNoExpandForbidClosed

      public static IndicesOptions strictSingleIndexNoExpandForbidClosed()
      Returns:
      indices option that requires each specified index or alias to exist, doesn't expand wildcards and throws error if any of the aliases resolves to multiple indices
    • lenientExpandOpen

      public static IndicesOptions lenientExpandOpen()
      Returns:
      indices options that ignores unavailable indices, expands wildcards only to open indices and allows that no indices are resolved from wildcard expressions (not returning an error).
    • lenientExpandOpenHidden

      public static IndicesOptions lenientExpandOpenHidden()
      Returns:
      indices options that ignores unavailable indices, expands wildcards to open and hidden indices, and allows that no indices are resolved from wildcard expressions (not returning an error).
    • lenientExpand

      public static IndicesOptions lenientExpand()
      Returns:
      indices options that ignores unavailable indices, expands wildcards to both open and closed indices and allows that no indices are resolved from wildcard expressions (not returning an error).
    • lenientExpandHidden

      public static IndicesOptions lenientExpandHidden()
      Returns:
      indices options that ignores unavailable indices, expands wildcards to all open and closed indices and allows that no indices are resolved from wildcard expressions (not returning an error).
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • concreteTargetOptions

      public IndicesOptions.ConcreteTargetOptions concreteTargetOptions()
      Returns the value of the concreteTargetOptions record component.
      Returns:
      the value of the concreteTargetOptions record component
    • wildcardOptions

      public IndicesOptions.WildcardOptions wildcardOptions()
      Returns the value of the wildcardOptions record component.
      Returns:
      the value of the wildcardOptions record component
    • gatekeeperOptions

      public IndicesOptions.GatekeeperOptions gatekeeperOptions()
      Returns the value of the gatekeeperOptions record component.
      Returns:
      the value of the gatekeeperOptions record component
    • failureStoreOptions

      public IndicesOptions.FailureStoreOptions failureStoreOptions()
      Returns the value of the failureStoreOptions record component.
      Returns:
      the value of the failureStoreOptions record component