2
votes

If I do a search directly to elasticsearch in a browser, such as:

http://localhost:9200/mydocs/_search?q=Awesome%20Search

What does the search body data actually look like? Is it doing a multi_match and including all fields? I've tried writing a multi_match including all the fields and I get different results from doing it right in the browser.

2

2 Answers

2
votes

?q=.... is not a multi_match query, this is URI query and it's using query_string query.

So your search is "translated" to:

{
  "query": {
    "query_string": {
      "query": "Awesome Search"
    }
  }
}
0
votes

You need to pass multi_match query as request body like this

curl -XGET 'http://localhost:9200/your_index/_search?pretty=true' -d '{"query":{"multi_match":{"query":"keyword","fields":["field1","field2"]}}}'