How to do a match_phrase query on all searchable fields instead of on a single field?
I do see in the documentation as mentioned below where search can be done on only specific field.
"match" and "match_phrase" query work on a single field.
If you want to use multiple fields with a phrase, you need to use multi_match query with type: phrase:
{
"query": {
"multi_match": {
"query": "this is a test",
"fields": ["*"],
"type" : "phrase"
}
}
}
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.