# How to search "X=X" in Elasticsearch

**URL:** https://discuss.elastic.co/t/how-to-search-x-x-in-elasticsearch/14435
**Category:** Elasticsearch
**Created:** [November 16, 2013, 1:25pm UTC](https://discuss.elastic.co/t/how-to-search-x-x-in-elasticsearch/14435 "2013-11-16T13:25:40Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![performonkey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/performonkey/32/1976_2.png) [@performonkey](https://discuss.elastic.co/u/performonkey)
#### Post date: [November 16, 2013, 1:25pm UTC](https://discuss.elastic.co/t/how-to-search-x-x-in-elasticsearch/14435/1 "2013-11-16T13:25:40Z")

</div>

Hi all:

I want search "X=X" in Elasticsearch, and this X equal to X.

just like this:

```
s=s

w=w

1=1

```

How to do this?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)
#### Post date: [November 18, 2013, 10:09am UTC](https://discuss.elastic.co/t/how-to-search-x-x-in-elasticsearch/14435/2 "2013-11-18T10:09:32Z")

</div>

Hi

I'm not totally sure what you are asking for, but my guess would be that  
the problem is that your query gets analyzed so the '=' sign is removed.  
You can try to use a term query[1] which is a query type that doesn't  
analyze the query and treats it as a single term. In order to use it,  
please make sure that the field you are searching on is not analyzed[2].

[1]  
[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-term-query.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-term-query.html)  
[2]  
[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-core-types.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-core-types.html)

--  
Adrien Grand

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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: [July 6, 2017, 2:06am UTC](https://discuss.elastic.co/t/how-to-search-x-x-in-elasticsearch/14435/3 "2017-07-06T02:06:29Z")

</div>


