I need to run an exact phrase match against all the fields under multiple indices.
The elastic java api has a method matchPhaseQuery
/**
* Creates a text query with type "PHRASE" for the provided field name and text.
*
* @param name The field name.
* @param text The query text (to be analyzed).
*/
public static MatchQueryBuilder matchPhraseQuery(String name, Object text) {
return new MatchQueryBuilder(name, text).type(MatchQueryBuilder.Type.PHRASE);
}
The problem is it requires the field names to run a match phrase query against. Whereas I need to run against all the fields under multiple indices.
Is there any way to achieve this?