Indices Queryedit

See Indices Query

// Using another query when no match for the main one
QueryBuilder qb = indicesQuery(
        termQuery("tag", "wow"),            
        "index1", "index2"                  
    )
    .noMatchQuery(termQuery("tag", "kow")); 

query to be executed on selected indices

selected indices

query to be executed on non matching indices

// Using all (match all) or none (match no documents)
QueryBuilder qb = indicesQuery(
        termQuery("tag", "wow"),            
        "index1", "index2"                  
    )
    .noMatchQuery("all");                   

query to be executed on selected indices

selected indices

none (to match no documents), and all (to match all documents). Defaults to all.