# Percolate Query Scoring and Fields

**URL:** <https://discuss.elastic.co/t/percolate-query-scoring-and-fields/16058>\
**Category:** Elasticsearch\
**Created:** [February 27, 2014, 8:35pm UTC](https://discuss.elastic.co/t/percolate-query-scoring-and-fields/16058 "2014-02-27T20:35:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_Bathgate\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/james_bathgate_2/32/1758_2.png) [@James\_Bathgate\_2](https://discuss.elastic.co/u/James_Bathgate_2)\
**Post date:** [February 27, 2014, 8:35pm UTC](https://discuss.elastic.co/t/percolate-query-scoring-and-fields/16058/1 "2014-02-27T20:35:43Z")

</div>

Is it possible to have a percolate query return a score for how well each  
percolate query matches the document and return extra fields from the  
percolate query as part of the results? Given the percolate query below:

{  
"query" : {  
"match" : {  
"query" : "blue"  
}  
},  
"other\_field" : "test"  
}

and the following document:

{  
"doc" : {  
"query" : "blue shoes nike"  
}  
}

I'd like to see a result something like this:

{  
"took": 1,  
"\_shards": {  
"total": 1,  
"successful": 1,  
"failed": 0  
},  
"total": 2,  
"matches": [  
{  
"\_index": "myIndex",  
"\_id": "1",  
"\_score" : 0.87  
"other\_field" : "test"  
}  
]  
}

Are either of these possible?

--  
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/094a55bf-83f1-44ee-9fbc-ce962a6fe711%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/094a55bf-83f1-44ee-9fbc-ce962a6fe711%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\_2](https://avatars.discourse-cdn.com/v4/letter/b/d07c76/32.png) [@Binh\_Ly\_2](https://discuss.elastic.co/u/Binh_Ly_2)\
**Post date:** [February 27, 2014, 9:58pm UTC](https://discuss.elastic.co/t/percolate-query-scoring-and-fields/16058/2 "2014-02-27T21:58:20Z")

</div>

Unfortunately neither is possible at the moment. The score part that you  
ask is interesting in which I could see some interesting applications. For  
the second one, you'll probably just need to do an \_mget or second search  
to retrieve extra metadata from the percolator queries. There is a scoring  
capability in the percolator in ES 1.0 but it is not the way you describe.  
It simply works by you supplying a query along with the percolate call and  
then a score will be computed based on the relevance of the query against  
the percolator queries metadata.

--  
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/0e48c6c4-7dff-40ba-8b68-f9749b5cc02e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0e48c6c4-7dff-40ba-8b68-f9749b5cc02e%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:** ![James\_Bathgate\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/james_bathgate_2/32/1758_2.png) [@James\_Bathgate\_2](https://discuss.elastic.co/u/James_Bathgate_2)\
**Post date:** [February 27, 2014, 10:05pm UTC](https://discuss.elastic.co/t/percolate-query-scoring-and-fields/16058/3 "2014-02-27T22:05:31Z")

</div>

Binh,

I was afraid of that. That lines up with all the information I've seen in  
the documentation. I was just hoping there was something I was missing.  
I've already done what you've suggested for fetching the fields. I guess I  
could attempt to score the results myself.

[http://www.searchspring.net/](http://www.searchspring.net/)James BathgateSr. Developer719.594.4595 ext.  
610

On Thu, Feb 27, 2014 at 1:58 PM, Binh Ly [binhly\_es@yahoo.com](mailto:binhly_es@yahoo.com) wrote:

> Unfortunately neither is possible at the moment. The score part that you  
> ask is interesting in which I could see some interesting applications. For  
> the second one, you'll probably just need to do an \_mget or second search  
> to retrieve extra metadata from the percolator queries. There is a scoring  
> capability in the percolator in ES 1.0 but it is not the way you describe.  
> It simply works by you supplying a query along with the percolate call and  
> then a score will be computed based on the relevance of the query against  
> the percolator queries metadata.
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/ZRJbcijOCMM/unsubscribe](https://groups.google.com/d/topic/elasticsearch/ZRJbcijOCMM/unsubscribe).  
> To unsubscribe from this group and all its topics, 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/0e48c6c4-7dff-40ba-8b68-f9749b5cc02e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0e48c6c4-7dff-40ba-8b68-f9749b5cc02e%40googlegroups.com)  
> .
> 
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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/CAJvHJZ1mnwc2%2BG18S-%2BXbgP12rRFp%2BoCMU2c\_ZVyDE5RDt0WWw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAJvHJZ1mnwc2%2BG18S-%2BXbgP12rRFp%2BoCMU2c_ZVyDE5RDt0WWw%40mail.gmail.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:46am UTC](https://discuss.elastic.co/t/percolate-query-scoring-and-fields/16058/4 "2017-07-06T01:46:48Z")

</div>


