# Function Score Query in elasticsearch-py

**URL:** <https://discuss.elastic.co/t/function-score-query-in-elasticsearch-py/14698>\
**Category:** Elasticsearch\
**Created:** [December 4, 2013, 10:00am UTC](https://discuss.elastic.co/t/function-score-query-in-elasticsearch-py/14698 "2013-12-04T10:00:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abhishek\_Kasina](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abhishek_kasina/32/1937_2.png) [@Abhishek\_Kasina](https://discuss.elastic.co/u/Abhishek_Kasina)\
**Post date:** [December 4, 2013, 10:00am UTC](https://discuss.elastic.co/t/function-score-query-in-elasticsearch-py/14698/1 "2013-12-04T10:00:51Z")

</div>

Is there a way to use the function score query[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html)feature in elastic search through their python  
library [http://elasticsearch-py.readthedocs.org/en/latest/api.html](http://elasticsearch-py.readthedocs.org/en/latest/api.html)? Has  
anyone successfully implemented it?

--  
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/74418f9f-12e5-4320-afed-6cf632a84ab0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/74418f9f-12e5-4320-afed-6cf632a84ab0%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:** ![Honza\_Kral](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/honza_kral/32/876_2.png) [@Honza\_Kral](https://discuss.elastic.co/u/Honza_Kral)\
**Post date:** [December 4, 2013, 12:01pm UTC](https://discuss.elastic.co/t/function-score-query-in-elasticsearch-py/14698/2 "2013-12-04T12:01:11Z")

</div>

Hi,

yes there is, the python library is very low level so once you construct  
the query as a dict you can use it:

es = Elasticsearch()  
es.search(body={"query": {"function\_score": {...}}})

should work just fine

On Wed, Dec 4, 2013 at 11:00 AM, Abhishek Kasina  
[kasina.abhishek@gmail.com](mailto:kasina.abhishek@gmail.com)wrote:

> Is there a way to use the function score query[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html)feature in Elasticsearch through their python  
> library [http://elasticsearch-py.readthedocs.org/en/latest/api.html](http://elasticsearch-py.readthedocs.org/en/latest/api.html)? Has  
> anyone successfully implemented it?
> 
> --  
> 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/74418f9f-12e5-4320-afed-6cf632a84ab0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/74418f9f-12e5-4320-afed-6cf632a84ab0%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/CABfdDirjYWTAyCfu\_AywVgCH7jXSDjdgy-v6y%2B9vzkS9deXyfg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CABfdDirjYWTAyCfu_AywVgCH7jXSDjdgy-v6y%2B9vzkS9deXyfg%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, 2:03am UTC](https://discuss.elastic.co/t/function-score-query-in-elasticsearch-py/14698/3 "2017-07-06T02:03:23Z")

</div>


