# Percolator issue?

**URL:** <https://discuss.elastic.co/t/percolator-issue/4601>\
**Category:** Elasticsearch\
**Created:** [June 10, 2011, 3:01pm UTC](https://discuss.elastic.co/t/percolator-issue/4601 "2011-06-10T15:01:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![asanderson](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@asanderson](https://discuss.elastic.co/u/asanderson)\
**Post date:** [June 10, 2011, 3:01pm UTC](https://discuss.elastic.co/t/percolator-issue/4601/1 "2011-06-10T15:01:00Z")

</div>

Greetings!

I just started evaluating ElasticSearch 0.16.2 as a possible Solr  
replacement, so I'm a newbie.

I tried the percolator example and it worked, but then I tried a  
slightly modified example and got no matches.

My slightly modified example was the following:

curl -XPUT localhost:9200/test  
{"ok":true,"acknowledged":true}

curl -XPUT localhost:9200/\_percolator/test/surname -d '{"query":  
{"term":{"surname":"Smith"}}}'  
{"ok":true,"\_index":"\_percolator","\_type":"test","\_id":"surname","\_version":  
1}

curl -XGET localhost:9200/test/person/\_percolate -d '{"doc":  
{"surname":"Smith"}}'  
{"ok":true,"matches":[]}

java -version  
java version "1.6.0\_24"  
Java(TM) SE Runtime Environment (build 1.6.0\_24-b07)  
Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)

uname -a  
Linux ubuntu-tcs4 2.6.35-22-generic #35-Ubuntu SMP Sat Oct 16 20:45:36  
UTC 2010 x86\_64 GNU/Linux

I must be doing something wrong or misunderstand how it works.

Please advise.

Thanks!

Steve

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [June 10, 2011, 3:31pm UTC](https://discuss.elastic.co/t/percolator-issue/4601/2 "2011-06-10T15:31:54Z")

</div>

Steve,

The term "Smith" is not analyzed in your percolator query but  
it's analyzed in your document (converted to smith). Therefore  
your percolator query doesn't match your document. The simplest way to fix  
it is by changing your query to analyzed version (basically use text instead  
of term):

curl -XPUT localhost:9200/\_percolator/test/surname -d '{"query":  
{"text":{"surname":"Smith"}}}'

Igor

On Fri, Jun 10, 2011 at 11:01 AM, asanderson [a.steven.anderson@gmail.com](mailto:a.steven.anderson@gmail.com)wrote:

> Greetings!
> 
> I just started evaluating Elasticsearch 0.16.2 as a possible Solr  
> replacement, so I'm a newbie.
> 
> I tried the percolator example and it worked, but then I tried a  
> slightly modified example and got no matches.
> 
> My slightly modified example was the following:
> 
> curl -XPUT localhost:9200/test  
> {"ok":true,"acknowledged":true}
> 
> curl -XPUT localhost:9200/\_percolator/test/surname -d '{"query":  
> {"term":{"surname":"Smith"}}}'
> 
> {"ok":true,"\_index":"\_percolator","\_type":"test","\_id":"surname","\_version":  
> 1}
> 
> curl -XGET localhost:9200/test/person/\_percolate -d '{"doc":  
> {"surname":"Smith"}}'  
> {"ok":true,"matches":}
> 
> java -version  
> java version "1.6.0\_24"  
> Java(TM) SE Runtime Environment (build 1.6.0\_24-b07)  
> Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)
> 
> uname -a  
> Linux ubuntu-tcs4 2.6.35-22-generic #35-Ubuntu SMP Sat Oct 16 20:45:36  
> UTC 2010 x86\_64 GNU/Linux
> 
> I must be doing something wrong or misunderstand how it works.
> 
> Please advise.
> 
> Thanks!
> 
> Steve

---

<div class="post-metadata">

**Author:** ![asanderson](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@asanderson](https://discuss.elastic.co/u/asanderson)\
**Post date:** [June 10, 2011, 4:36pm UTC](https://discuss.elastic.co/t/percolator-issue/4601/3 "2011-06-10T16:36:26Z")

</div>

> The term "Smith" is not analyzed in your percolator query but  
> it's analyzed in your document (converted to smith). Therefore  
> your percolator query doesn't match your document. The simplest way to fix  
> it is by changing your query to analyzed version (basically use text instead  
> of term):
> 
> curl -XPUT localhost:9200/\_percolator/test/surname -d '{"query":  
> {"text":{"surname":"Smith"}}}'

Ahhh...I knew there had to be something simple that I was missing.

Thanks!

Steve

---

<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, 4:03am UTC](https://discuss.elastic.co/t/percolator-issue/4601/4 "2017-07-06T04:03:50Z")

</div>


