# Percolaror with exact match

**URL:** https://discuss.elastic.co/t/percolaror-with-exact-match/15345
**Category:** Elasticsearch
**Created:** [January 21, 2014, 3:55pm UTC](https://discuss.elastic.co/t/percolaror-with-exact-match/15345 "2014-01-21T15:55:12Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Tomasz\_Romanczuk](https://avatars.discourse-cdn.com/v4/letter/t/5e9695/32.png) [@Tomasz\_Romanczuk](https://discuss.elastic.co/u/Tomasz_Romanczuk)
#### Post date: [January 21, 2014, 3:55pm UTC](https://discuss.elastic.co/t/percolaror-with-exact-match/15345/1 "2014-01-21T15:55:12Z")

</div>

I'm going to use percolate option to index my queries. Some of them  
contains special characters (like "-", "+"). For given document i.e.:

doc {  
source: "[www.a-b.com](http://www.a-b.com)"  
}

I need return only these queries that exactly match to this text. I used  
_termQuery_ from JavaAPI but it doesn't work. How can I provide "exact  
match"?

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/00a58083-c06d-442e-8550-5ef5c81fe448%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/00a58083-c06d-442e-8550-5ef5c81fe448%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Binh\_Ly](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@Binh\_Ly](https://discuss.elastic.co/u/Binh_Ly)
#### Post date: [January 21, 2014, 4:50pm UTC](https://discuss.elastic.co/t/percolaror-with-exact-match/15345/2 "2014-01-21T16:50:02Z")

</div>

You can handle the "matching" part by defining the correct analyzer for the  
source field. So for example, if you set define source as "not\_analyzed",  
it should perform a case-sensitive exact match without going through text  
analysis.

On Tuesday, January 21, 2014 10:55:12 AM UTC-5, Tomasz Romanczuk wrote:

> I'm going to use percolate option to index my queries. Some of them  
> contains special characters (like "-", "+"). For given document i.e.:
> 
> doc {  
> source: "[www.a-b.com](http://www.a-b.com)"  
> }
> 
> I need return only these queries that exactly match to this text. I used  
> _termQuery_ from JavaAPI but it doesn't work. How can I provide "exact  
> match"?

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/8d896c97-702a-4ccb-880d-5a1bd186a5be%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8d896c97-702a-4ccb-880d-5a1bd186a5be%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Tomasz\_Romanczuk](https://avatars.discourse-cdn.com/v4/letter/t/5e9695/32.png) [@Tomasz\_Romanczuk](https://discuss.elastic.co/u/Tomasz_Romanczuk)
#### Post date: [January 21, 2014, 10:32pm UTC](https://discuss.elastic.co/t/percolaror-with-exact-match/15345/3 "2014-01-21T22:32:29Z")

</div>

Where should I define source as not\_analyzed? During index creation (in  
mapping)? or in queries?

W dniu wtorek, 21 stycznia 2014 17:50:02 UTC+1 użytkownik Binh Ly napisał:

> You can handle the "matching" part by defining the correct analyzer for  
> the source field. So for example, if you set define source as  
> "not\_analyzed", it should perform a case-sensitive exact match without  
> going through text analysis.
> 
> On Tuesday, January 21, 2014 10:55:12 AM UTC-5, Tomasz Romanczuk wrote:
> 
> > I'm going to use percolate option to index my queries. Some of them  
> > contains special characters (like "-", "+"). For given document i.e.:
> > 
> > doc {  
> > source: "[www.a-b.com](http://www.a-b.com)"  
> > }
> > 
> > I need return only these queries that exactly match to this text. I used  
> > _termQuery_ from JavaAPI but it doesn't work. How can I provide "exact  
> > match"?

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/add8adb3-516e-494f-b129-8f05146e34ef%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/add8adb3-516e-494f-b129-8f05146e34ef%40googlegroups.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, 1:55am UTC](https://discuss.elastic.co/t/percolaror-with-exact-match/15345/4 "2017-07-06T01:55:31Z")

</div>


