I'm using the following query:
dis_max: {
queries: [
{"multi_match": { "fields": ["b.*"], "text": "foo", "fuzziness": 2},
{"multi_match": { "fields": ["a"], "text": "foo", "fuzziness": 0}
]
}
Where a
is a required field, but b.*
is not.
It works fine most of the time, but when I start my application from scratch, I can get into a state where nothing under b
gets indexed. And since I'm using dynamic mappings for b
, this means that the query fails with:
! org.elasticsearch.index.query.QueryParsingException: No fields specified for multi_match query
I'd like to tell the second multi_match query to simply not match when the wildcard doesn't expand to any known fields.
Is this possible?