# Search for a negative value

**URL:** <https://discuss.elastic.co/t/search-for-a-negative-value/241159>\
**Category:** Elasticsearch\
**Created:** [July 14, 2020, 3:38pm UTC](https://discuss.elastic.co/t/search-for-a-negative-value/241159 "2020-07-14T15:38:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Katia](https://avatars.discourse-cdn.com/v4/letter/k/b5e925/32.png) [@Katia](https://discuss.elastic.co/u/Katia)\
**Post date:** [July 14, 2020, 3:38pm UTC](https://discuss.elastic.co/t/search-for-a-negative-value/241159/1 "2020-07-14T15:38:58Z")

</div>

I have indexed fields containing character codes such as 3 1 1 and 3 1 -1.  
But when I search 3 1 -1 it seems that the "-" is not supported!  
could you please help me?

```auto
GET /_search
{
    "query": {
        "match_phrase" : {
            "champ" : "3 1 -1"
        }
    }
}

```

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [July 14, 2020, 4:18pm UTC](https://discuss.elastic.co/t/search-for-a-negative-value/241159/2 "2020-07-14T16:18:39Z")

</div>

That is really an elasticsearch question rather than a logstash question and you might get a better answer if you moved the question to that forum.

That said, I think the [standard tokenizer](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-standard-tokenizer.html) would remove the - from the -1, so the -1 is indexed as if it were 1 and so you cannot search for -1

---

<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:** [August 11, 2020, 4:18pm UTC](https://discuss.elastic.co/t/search-for-a-negative-value/241159/3 "2020-08-11T16:18:45Z")

</div>

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