Search over all fields

Hi, i have a index with multiple documents with severeal fields. I want to be able to search over all the fields without using multi_match and manualy writing each field. Is there a way to do this?

Here is an example of how it would be done with multi_match, but i get errors since the fields have different types.

GET new_document-20_v2/_search
{
  "query": {
    "multi_match" : {
      "query":    "2008", 
      "fields": ["Document name", "Project number", ....(etc, i have about 30 fields)]

    }
  }
}

Any help would be greatly appreciated!

Why not using a simple_query_string query instead? Would that work for you?

Thank you for the anwser!
This worked to some degree. But it did not return all the results.

After running a simple_query_string on the query 2008. The search only returns two documents, even though i have alot more documents than two that contains fields with "2008" in them.
I also tried to include 'size' and set it to 1000, but this did nothing.

Is it posible to query in a way that returns all the results?

Could you provide a full recreation script as described in About the Elasticsearch category. It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

A full reproduction script is something anyone can copy and paste in Kibana dev console, click on the run button to reproduce your use case. It will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.