# Global Search

**URL:** https://discuss.elastic.co/t/global-search/294887
**Category:** Elasticsearch
**Created:** [January 20, 2022, 1:39am UTC](https://discuss.elastic.co/t/global-search/294887 "2022-01-20T01:39:29Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Prabakar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prabakar/32/81795_2.png) [@Prabakar](https://discuss.elastic.co/u/Prabakar)
#### Post date: [January 20, 2022, 1:39am UTC](https://discuss.elastic.co/t/global-search/294887/1 "2022-01-20T01:39:29Z")

</div>

Hello Everyone,

I would like to perform a global search by providing a keyword like below (2 different requests) in the request. It returns the result which matches the word "pizza" in any of the field. But if I give "piz" in the request then it is not returning anything. Ultimately it expects complete word instead partial word. If I want to use any search string like "piz", may I know what do I need to do? Because when user performs global search then we can't expect exact word which matches. Please share your thoughts on this.

GET /\_search  
{  
"query": {  
"multi\_match" : {  
"query" : " **pizza**",  
"fields" :   
}  
}  
}

GET /\_search  
{  
"query": {  
"simple\_query\_string" : {  
"query": "Dominos"  
}  
}  
}

---

<div class="post-metadata">

### Author: ![Tomo\_M](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tomo\_M](https://discuss.elastic.co/u/Tomo_M)
#### Post date: [January 20, 2022, 4:01am UTC](https://discuss.elastic.co/t/global-search/294887/2 "2022-01-20T04:01:00Z")

</div>

There are several ways to tackle this problem. You have to take balance between recall and precision. [`fuzziness`](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html) option is a good start point. You can use `fuzziness` also in [`multi_match`](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html#type-bool-prefix) queries and [`query-string`](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-top-level-params) queries. If you want exact partial match, you can use n-gram analyzer or wildcard query with wildcard field.

---

<div class="post-metadata">

### Author: ![Prabakar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prabakar/32/81795_2.png) [@Prabakar](https://discuss.elastic.co/u/Prabakar)
#### Post date: [January 20, 2022, 5:19am UTC](https://discuss.elastic.co/t/global-search/294887/3 "2022-01-20T05:19:53Z")

</div>

Can you please share some examples if possible. That will be great. Because Fuzziness link which you have shared is not helping for my scenario, it seems it mentioned the field name called "message". But in my case, I do not want to mention the specific field name. It is completely global within index.

---

<div class="post-metadata">

### Author: ![Tomo\_M](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tomo\_M](https://discuss.elastic.co/u/Tomo_M)
#### Post date: [January 20, 2022, 5:41am UTC](https://discuss.elastic.co/t/global-search/294887/4 "2022-01-20T05:41:27Z")

</div>

You can use fuzziness with multi\_match query as I said.

---

<div class="post-metadata">

### Author: ![Prabakar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prabakar/32/81795_2.png) [@Prabakar](https://discuss.elastic.co/u/Prabakar)
#### Post date: [January 20, 2022, 6:36am UTC](https://discuss.elastic.co/t/global-search/294887/5 "2022-01-20T06:36:56Z")

</div>

Yes, I used fuzziness like below. If I give "pizza" or "pizz" is working fine, but if I give"pi" then it is not returning any results. Fuzziness working partially.

GET /\_search  
{  
"query": {  
"multi\_match" : {  
"query" : "pizz",  
"fuzziness": "AUTO",  
"fields" :   
}  
}  
}

---

<div class="post-metadata">

### Author: ![Tomo\_M](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tomo\_M](https://discuss.elastic.co/u/Tomo_M)
#### Post date: [January 20, 2022, 6:49am UTC](https://discuss.elastic.co/t/global-search/294887/6 "2022-01-20T06:49:55Z")

</div>

> [@Tomo\_M](#):
>
> between recall and precision.

Yes, that is what i said the balance between recall and precision. 'AUTO' allows one edit for 5 letter term. if you set "fusiness": 2, "piz" will match but "pi" will not. The advantage of fuzziness query is that can match something like "piza" or "pissa".

Again, another way is to use n-gram analyzer or wildcard query with wildcard field.

---

<div class="post-metadata">

### Author: ![Prabakar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prabakar/32/81795_2.png) [@Prabakar](https://discuss.elastic.co/u/Prabakar)
#### Post date: [January 20, 2022, 4:59pm UTC](https://discuss.elastic.co/t/global-search/294887/7 "2022-01-20T16:59:25Z")

</div>

Thank you. Wild card works.

---

<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: [February 17, 2022, 5:00pm UTC](https://discuss.elastic.co/t/global-search/294887/8 "2022-02-17T17:00:19Z")

</div>

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