# ES behaviour with characters like $ and @ in a query?

**URL:** https://discuss.elastic.co/t/es-behaviour-with-characters-like-and-in-a-query/171400
**Category:** Elasticsearch
**Created:** [March 7, 2019, 11:30pm UTC](https://discuss.elastic.co/t/es-behaviour-with-characters-like-and-in-a-query/171400 "2019-03-07T23:30:51Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![neesha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/neesha/32/50845_2.png) [@neesha](https://discuss.elastic.co/u/neesha)
#### Post date: [March 7, 2019, 11:30pm UTC](https://discuss.elastic.co/t/es-behaviour-with-characters-like-and-in-a-query/171400/1 "2019-03-07T23:30:52Z")

</div>

I'm trying to test out how our system (and ES) actually change what a user is submitting into a query and what the expected response back should be. I have a post that has in it's content "Nee$ha". So I have submitted the search query of "nee$ha". In the response, I noticed that the highlighted information that comes back is:  
`"[bold]nee[/bold]$[bold]ha[/bold]"`

When I run `nee$ha` through the analyzer, I notice it gets split into two tokens:

```auto
    curl -X GET "localhost:9200/_analyze" -H 'Content-Type: application/json' -d'
     {
        "analyzer": "standard",
        "text": "nee$ha"
    }'

```

Response:

```auto
{"tokens":[{"token":"nee","start_offset":0,"end_offset":3,"type":"<ALPHANUM>","position":0},{"token":"ha","start_offset":4,"end_offset":6,"type":"<ALPHANUM>","position":1}]}%

```

What I can't quite figure out, is what is actually happening in ES. I _think_ it's turning it into an `AND` query, requiring for both `nee` and `ha` in the same result. And that the `$` essentially is considered a delimiter between words much like a `.` or `,`. It's being passed into the query as `"query": "content:(\"nee$ha\")"` so it hasn't been explicitly turned into an `AND` and our default operator is an `OR`.

Is this the right interpretation? And, more so, how do I get it to actually search for the `$` and not ignore it?

---

<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 4, 2019, 11:30pm UTC](https://discuss.elastic.co/t/es-behaviour-with-characters-like-and-in-a-query/171400/2 "2019-04-04T23:30:52Z")

</div>

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