# Questions about using must, should words together and Turkish char problem

**URL:** <https://discuss.elastic.co/t/questions-about-using-must-should-words-together-and-turkish-char-problem/289755>\
**Category:** Elasticsearch\
**Created:** [November 20, 2021, 8:52pm UTC](https://discuss.elastic.co/t/questions-about-using-must-should-words-together-and-turkish-char-problem/289755 "2021-11-20T20:52:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aox](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aox/32/97351_2.png) [@aox](https://discuss.elastic.co/u/aox)\
**Post date:** [November 20, 2021, 8:52pm UTC](https://discuss.elastic.co/t/questions-about-using-must-should-words-together-and-turkish-char-problem/289755/1 "2021-11-20T20:52:43Z")

</div>

Hello

I am using Elasticsearch-oss-7.10.2-1.x86\_64. I have 2 questions:

Question 1)

I want to combine this query results:

```auto
GET /turkish_example/_search
{
  "query": {
		"bool": {
		  "should": [
			  {
				  "simple_query_string": {
					"fields" : ["adi1","adi2","cevirmen","yazar","sku","listprice"],
					"query" : "MÜBECCEL KIRAY",
								"default_operator": "and"
				  }
			  },
			  {
				  "simple_query_string": {
					"fields" : ["adi1","adi2","cevirmen","yazar","sku","listprice"],
					"query" : "MÜBECCEL KıRAY",
								"default_operator": "and"
				  }
			  },			  
			  {"term": {"adi1": "Mübeccel B. Kıray"}},
			  {"term": {"adi2": "Mübeccel B. Kıray"}}			  
		  ]
		
	  }
  },
  "size": 200,
  "_source": true,
  "fields":["adi1","adi2","sku","cevirmen","basim_tarihi","basim_yeri", "sayfa_sayisi","yazar"]
}

```

with:

```auto
{ 
          "bool": {
      "must_not": [
        { 
          "term": {
            "localinventory": "0"
          }
}

```

I want to show all results of first query if localinventory is not 0. Is it posible to use should and must words together?

How can I do that?

Question 2)

When I searched for "MÜBECCEL KIRAY" only, I cannot see results properly. I think this problem is related with Turkish chars. Upper I letter should be converted as (lower ı or lower i). I solved this problem by adding some additional queries with "should" word. Is there another suggestion for solving this problem. If I use a single query by replacing I char with ı this time my query doesn't work for "Gurbetteki Kafkasya II". Because II letters shouldn't be replaced like ıı... Using 2 queries solved my problem. Do you have different suggestions?

I tried to create an index by following this document but it didn't help.

> **[Language analyzers | Elasticsearch Guide \[7.15\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-lang-analyzer.html#turkish-analyzer)**

---

<div class="post-metadata">

**Author:** ![aox](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aox/32/97351_2.png) [@aox](https://discuss.elastic.co/u/aox)\
**Post date:** [November 20, 2021, 9:06pm UTC](https://discuss.elastic.co/t/questions-about-using-must-should-words-together-and-turkish-char-problem/289755/2 "2021-11-20T21:06:05Z")

</div>

I solved this by using following syntax:

```auto
GET /kutuphane/_search
{
   "query":{
      "bool":{
         "must":[
            {
               "simple_query_string":{
                  "fields":[
                     "adi1",
                     "adi2",
                     "cevirmen",
                     "yazar",
                     "sku",
                     "listprice"
                  ],
                  "query":"(MÜBECCEL KIRAY' | MÜBECCEL KıRAY)",
                  "default_operator":"and"
               }
            },
            {
               "bool":{
                  "should":[
                     {
               "simple_query_string":{
                  "fields":[
                     "adi1",
                     "adi2",
                     "cevirmen",
                     "yazar",
                     "sku",
                     "listprice"
                  ],
                  "query":"(MÜBECCEL KIRAY' | MÜBECCEL KıRAY)",
                  "default_operator":"and"
               }
            },
                          {"term": {"adi1": "MÜBECCEL KIRAY"}},
                          {"term": {"adi2": "MÜBECCEL KIRAY"}}
            
                  ]
               }
            },
            {
               "bool":{
                  "must_not":[
                     {
                        "term":{
                           "localinventory":"0"
                        }
                     }
                  ]
               }
            }
         ]
      }
   },
   "size":200,
   "_source":true,
   "fields":[
      "adi1",
      "adi2",
      "sku",
      "cevirmen",
      "basim_tarihi",
      "basim_yeri",
      "sayfa_sayisi",
      "yazar"
   ]
}

```

But I will be happy to hear different suggestions. I am new on ELK queries.

---

<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:** [December 18, 2021, 9:06pm UTC](https://discuss.elastic.co/t/questions-about-using-must-should-words-together-and-turkish-char-problem/289755/3 "2021-12-18T21:06:09Z")

</div>

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