<commit_before>[[query-dsl-indices-query]]
=== Indices Query

The `indices` query can be used when executed across multiple indices,
allowing to have a query that executes only when executed on an index
that matches a specific list of indices, and another query that executes
when it is executed on an index that does not match the listed indices.

[source,js]
--------------------------------------------------
{
    "indices" : {
        "indices" : ["index1", "index2"],
        "query" : {
            "term" : { "tag" : "wow" }
        },
        "no_match_query" : {
            "term" : { "tag" : "kow" }
        }
    }
}<commit_msg>Docs: Update indices-query.asciidoc<commit_after>[[query-dsl-indices-query]]
=== Indices Query

The `indices` query is useful in cases where a search is executed across
multiple indices. It allows to specify a list of index names and an inner
query that is only executed for indices matching names on that list.
For other indices that are searched, but that don't match entries
on the list, the alternative `no_match_query` is executed.

[source,js]
--------------------------------------------------
{
    "indices" : {
        "indices" : ["index1", "index2"],
        "query" : {
            "term" : { "tag" : "wow" }
        },
        "no_match_query" : {
            "term" : { "tag" : "kow" }
        }
    }
}
{'fraction_non_alphanumeric': 0.18248712288447388, 'fraction_numerical': 0.0029433406916850625, 'mean_word_length': 2.056179775280899, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3426343', 'n_tokens_mistral': 383, 'n_tokens_neox': 379, 'n_words': 142}