# Multiword exact search

**URL:** <https://discuss.elastic.co/t/multiword-exact-search/334490>\
**Category:** Kibana\
**Tags:** search\
**Created:** [May 27, 2023, 6:03am UTC](https://discuss.elastic.co/t/multiword-exact-search/334490 "2023-05-27T06:03:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matej\_Senozetnik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matej_senozetnik/32/121517_2.png) [@Matej\_Senozetnik](https://discuss.elastic.co/u/Matej_Senozetnik)\
**Post date:** [May 27, 2023, 6:03am UTC](https://discuss.elastic.co/t/multiword-exact-search/334490/1 "2023-05-27T06:03:07Z")

</div>

Hello,

I would kindly ask how to make multi words search with multi keywords. I would like to achive following for SATB2 syndrome would like that I found exact following words:  
Prader-Willi syndrome (all varation of low and capital latters, but remain word order)  
Prader Willi syndrome (the same as above)  
#PraderWilliSyndrome (the same as above)  
#PraderWilli (the same as above)

The problem is that somtimes finds autor as Prader or Willi which is wrong I would need exact words order happen in text.

My python code is as is following:

```auto

    query = {
        "query": {
            "query_string": {
                "query": (Prader-Willi syndrome) OR Prader Willi syndrome) OR (#PraderWilliSyndrome) OR (#PraderWilli),
                "default_operator": "AND",
                "default_field": "text"
            }
        },
        "_source": ["id"]
    }
    res = es.search(index=index, body=query, scroll='60m', size=10000, request_timeout=30)

```

I do query\_string try to use AND operator, that every word in brackets will be searched as exact.  
How is possible that it found Prader or Willi separatly without other words ?

---

<div class="post-metadata">

**Author:** ![Priscilla\_Parodi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/priscilla_parodi/32/43047_2.png) [@Priscilla\_Parodi](https://discuss.elastic.co/u/Priscilla_Parodi)\
**Post date:** [May 28, 2023, 12:27am UTC](https://discuss.elastic.co/t/multiword-exact-search/334490/2 "2023-05-28T00:27:07Z")

</div>

Hello Matej, welcome to the community!

Have you tried each of these phrases surrounded by double quotes?

Something like:

```auto

"query": "\"Prader-Willi syndrome\" OR \"Prader Willi syndrome\" OR \"#PraderWilliSyndrome\" OR \"#PraderWilli\"",

```

You can read more about the syntax [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html).

---

<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:** [June 25, 2023, 12:28am UTC](https://discuss.elastic.co/t/multiword-exact-search/334490/3 "2023-06-25T00:28:05Z")

</div>

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