# Elastichsearch range query does not work with icu\_collation for Turkish words

**URL:** <https://discuss.elastic.co/t/elastichsearch-range-query-does-not-work-with-icu-collation-for-turkish-words/125353>\
**Category:** Elasticsearch\
**Created:** [March 23, 2018, 10:50am UTC](https://discuss.elastic.co/t/elastichsearch-range-query-does-not-work-with-icu-collation-for-turkish-words/125353 "2018-03-23T10:50:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gulcabuk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gulcabuk/32/18508_2.png) [@gulcabuk](https://discuss.elastic.co/u/gulcabuk)\
**Post date:** [March 23, 2018, 10:50am UTC](https://discuss.elastic.co/t/elastichsearch-range-query-does-not-work-with-icu-collation-for-turkish-words/125353/1 "2018-03-23T10:50:47Z")

</div>

Hi,

I've document which has Turkish words like "şa, za, sb, şc, sd, şe" etc. as customer\_address property.

I've indexed my documents as documented below because I want to order documents according to the customer\_address field. Sorting is working well. Sorting and Collations

Now I'm trying to apply range query over "customer\_address" field. When I sent the query below, I've got an empty result. (expected result: sb, sd, şa, şd)

```
    `curl -XGET http://localhost:9200/sampleindex/_search?pretty -d '{"query":{"bool":{"filter":[{"range":{"customer_address.sort":{"from":"plaj","to":"şcam","include_lower":true,"include_upper":true,"boost":1.0}}}],"disable_coord":false,"adjust_pure_negative":true,"boost":1.0}}}'`

```

When I've queried I saw that my fields are encrypted as specified in the document.

```
curl -XGET http://localhost:9200/sampleindex/_search?pretty -d '{"aggs":{"myaggregation":{"terms":{"field":"customer_address.sort","size":10000}}},"size":0}'

{
"took" : 5,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
    "total" : 6,
    "max_score" : 0.0,
    "hits" : []
  }
"aggregations" : {
    "a" : {
      "doc_count_error_upper_bound" : 0,
      "sum_other_doc_count" : 0,
      "buckets" : [
        {
          "key" : "⚕䁁䀠怀\u0001",
          "doc_count" : 1
        },
        {
          "key" : "⚗䁁䀠怀\u0001",
          "doc_count" : 1
        },
        {
          "key" : "✁ੀ⃀ၠ\u0000\u0000",
          "doc_count" : 1
        },
        {
          "key" : "✁ୀ⃀ၠ\u0000\u0000",
          "doc_count" : 1
        },
        {
          "key" : "✁ీ⃀ၠ\u0000\u0000",
          "doc_count" : 1
        },
        {
          "key" : "ⶔ䁁䀠怀\u0001",
          "doc_count" : 1
        }
      ]
    }
  }
}  

```

So, How should I send my parameters in the range query to be able to get the successful result?

Thanks in advance.

My Mapping:

```
curl -XGET http://localhost:9200/sampleindex?pretty
{
  "sampleindex" : {
    "aliases" : { },
    "mappings" : {
      "invoice" : {
        "properties" : {
          "customer_address" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword"
              },
              "sort" : {
                "type" : "text",
                "analyzer" : "turkish",
                "fielddata" : true
              }
            }
          }
       } 
    },
    "settings" : {
      "index" : {
        "number_of_shards" : "5",
        "provided_name" : "sampleindex",
        "max_result_window" : "2147483647",
        "creation_date" : "1521732167023",
        "analysis" : {
          "filter" : {
            "turkish_phonebook" : {
              "variant" : "@collation=phonebook",
              "country" : "TR",
              "language" : "tr",
              "type" : "icu_collation"
            },
            "turkish_lowercase" : {
              "type" : "lowercase",
              "language" : "turkish"
            }
          },
          "analyzer" : {
            "turkish" : {
              "filter" : [
                "turkish_lowercase",
                "turkish_phonebook"
              ],
              "tokenizer" : "keyword"
            }
          }
        },
        "number_of_replicas" : "1",
        "uuid" : "ChNGX459TUi8VnBLTMn-Ng",
        "version" : {
          "created" : "5020099"
        }
      }
    }
  }
}
```

---

<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:** [April 20, 2018, 10:50am UTC](https://discuss.elastic.co/t/elastichsearch-range-query-does-not-work-with-icu-collation-for-turkish-words/125353/2 "2018-04-20T10:50:52Z")

</div>

Closed on April 20, 2018, 10:50am UTC

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