# Comparisons with empty strings

**URL:** <https://discuss.elastic.co/t/comparisons-with-empty-strings/264808>\
**Category:** Elasticsearch\
**Created:** [February 19, 2021, 7:41am UTC](https://discuss.elastic.co/t/comparisons-with-empty-strings/264808 "2021-02-19T07:41:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sultanao](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@sultanao](https://discuss.elastic.co/u/sultanao)\
**Post date:** [February 19, 2021, 7:41am UTC](https://discuss.elastic.co/t/comparisons-with-empty-strings/264808/1 "2021-02-19T07:41:56Z")

</div>

Hi, I am using Elasticsearch 6.6.0 and I noticed that this query:

```auto
    {
      "query": {
        "range": {
          "my_alphanumeric_field": {
            "from": "",
            "to": null,
            "include_lower": false,
            "include_upper": true,
            "boost": 1
          }
        }
      }
    }

```

returns nothing. Why? It looks strange, considering that Java statements like notEmptyString.compareTo("") return a positive number, so my expectation is that the result set contains all documents having not empty values for field "my\_alphanumeric\_field".  
I would appreciate a clarification. Thanks.

---

<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:** [March 19, 2021, 7:42am UTC](https://discuss.elastic.co/t/comparisons-with-empty-strings/264808/2 "2021-03-19T07:42:39Z")

</div>

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