# Search over all fields

**URL:** <https://discuss.elastic.co/t/search-over-all-fields/271511>\
**Category:** Elasticsearch\
**Created:** [April 28, 2021, 12:33pm UTC](https://discuss.elastic.co/t/search-over-all-fields/271511 "2021-04-28T12:33:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sander\_Marx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sander_marx/32/80406_2.png) [@Sander\_Marx](https://discuss.elastic.co/u/Sander_Marx)\
**Post date:** [April 28, 2021, 12:33pm UTC](https://discuss.elastic.co/t/search-over-all-fields/271511/1 "2021-04-28T12:33:22Z")

</div>

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.

```auto
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!

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 28, 2021, 1:31pm UTC](https://discuss.elastic.co/t/search-over-all-fields/271511/2 "2021-04-28T13:31:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Sander\_Marx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sander_marx/32/80406_2.png) [@Sander\_Marx](https://discuss.elastic.co/u/Sander_Marx)\
**Post date:** [April 28, 2021, 2:15pm UTC](https://discuss.elastic.co/t/search-over-all-fields/271511/3 "2021-04-28T14:15:33Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 28, 2021, 8:33pm UTC](https://discuss.elastic.co/t/search-over-all-fields/271511/4 "2021-04-28T20:33:13Z")

</div>

Could you provide a full recreation script as described in [About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). 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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 26, 2021, 8:34pm UTC](https://discuss.elastic.co/t/search-over-all-fields/271511/5 "2021-05-26T20:34:07Z")

</div>

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