# Python support for custom score

**URL:** <https://discuss.elastic.co/t/python-support-for-custom-score/7010>\
**Category:** Elasticsearch\
**Created:** [March 14, 2012, 10:22pm UTC](https://discuss.elastic.co/t/python-support-for-custom-score/7010 "2012-03-14T22:22:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brandon\_Hilkert](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_hilkert/32/2182_2.png) [@Brandon\_Hilkert](https://discuss.elastic.co/u/Brandon_Hilkert)\
**Post date:** [March 14, 2012, 10:22pm UTC](https://discuss.elastic.co/t/python-support-for-custom-score/7010/1 "2012-03-14T22:22:21Z")

</div>

I'm trying to use a python script to create a custom score. I installed the  
plugin doing this:

bin/plugin -install elasticsearch/elasticsearch-lang-python/1.1.0

It seemed to work fine. When the server starts up, I get this:

2012-03-14 18:18:33,103][INFO][node] [Grey King]  
{0.18.7}[1062]: initializing ...  
[2012-03-14 18:18:33,115][INFO][plugins] [Grey King]  
loaded [lang-python], sites []  
[2012-03-14 18:18:34,294][WARN][script] [Grey King] no  
script engine found for [py]  
[2012-03-14 18:18:34,529][INFO][node] [Grey King]  
{0.18.7}[1062]: initialized  
[2012-03-14 18:18:34,529][INFO][node] [Grey King]  
{0.18.7}[1062]: starting ...

Result of query trying to use it is:

nested: ElasticSearchIllegalArgumentException[script\_lang not supported  
[python]]; }]","status":500}

What else do I need to do to support a Python script?

Thanks,  
Brandon

---

<div class="post-metadata">

**Author:** ![Brandon\_Hilkert](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_hilkert/32/2182_2.png) [@Brandon\_Hilkert](https://discuss.elastic.co/u/Brandon_Hilkert)\
**Post date:** [March 14, 2012, 11:53pm UTC](https://discuss.elastic.co/t/python-support-for-custom-score/7010/2 "2012-03-14T23:53:07Z")

</div>

Just to add some clarification, here is the query:

curl -X GET "[http://localhost:9200/employers/employer/\_search?pretty=true](http://localhost:9200/employers/employer/_search?pretty=true)"  
-d  
'{"query":{"custom\_score":{"params":{"param1":3},"script":"weight(param1)","lang":"python","query":{"query\_string":{"query":"fa\*"}}}}}'

On Wednesday, March 14, 2012 6:22:21 PM UTC-4, Brandon Hilkert wrote:

> I'm trying to use a python script to create a custom score. I installed  
> the plugin doing this:
> 
> bin/plugin -install elasticsearch/elasticsearch-lang-python/1.1.0
> 
> It seemed to work fine. When the server starts up, I get this:
> 
> 2012-03-14 18:18:33,103][INFO][node] [Grey King]  
> {0.18.7}[1062]: initializing ...  
> [2012-03-14 18:18:33,115][INFO][plugins] [Grey King]  
> loaded [lang-python], sites   
> [2012-03-14 18:18:34,294][WARN][script] [Grey King] no  
> script engine found for [py]  
> [2012-03-14 18:18:34,529][INFO][node] [Grey King]  
> {0.18.7}[1062]: initialized  
> [2012-03-14 18:18:34,529][INFO][node] [Grey King]  
> {0.18.7}[1062]: starting ...
> 
> Result of query trying to use it is:
> 
> nested: ElasticSearchIllegalArgumentException[script\_lang not supported  
> [python]]; }]","status":500}
> 
> What else do I need to do to support a Python script?
> 
> Thanks,  
> Brandon

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 16, 2012, 5:07pm UTC](https://discuss.elastic.co/t/python-support-for-custom-score/7010/3 "2012-03-16T17:07:12Z")

</div>

Check the readme: [GitHub - elastic/elasticsearch-lang-python: Python language Plugin for elasticsearch](https://github.com/elasticsearch/elasticsearch-lang-python),  
1.1.0 only supports 0.19.0, not 0.18 version.

On Thu, Mar 15, 2012 at 1:53 AM, Brandon Hilkert [brandon@meeteor.com](mailto:brandon@meeteor.com)wrote:

> Just to add some clarification, here is the query:
> 
> curl -X GET "[http://localhost:9200/employers/employer/\_search?pretty=true](http://localhost:9200/employers/employer/_search?pretty=true)"  
> -d  
> '{"query":{"custom\_score":{"params":{"param1":3},"script":"weight(param1)","lang":"python","query":{"query\_string":{"query":"fa\*"}}}}}'
> 
> On Wednesday, March 14, 2012 6:22:21 PM UTC-4, Brandon Hilkert wrote:
> 
> > I'm trying to use a python script to create a custom score. I installed  
> > the plugin doing this:
> > 
> > bin/plugin -install elasticsearch/elasticsearch-\*\*lang-python/1.1.0
> > 
> > It seemed to work fine. When the server starts up, I get this:
> > 
> > 2012-03-14 18:18:33,103][INFO][node] [Grey King]  
> > {0.18.7}[1062]: initializing ...  
> > [2012-03-14 18:18:33,115][INFO][plugins] [Grey King]  
> > loaded [lang-python], sites   
> > [2012-03-14 18:18:34,294][WARN][script] [Grey King]  
> > no script engine found for [py]  
> > [2012-03-14 18:18:34,529][INFO][node] [Grey King]  
> > {0.18.7}[1062]: initialized  
> > [2012-03-14 18:18:34,529][INFO][node] [Grey King]  
> > {0.18.7}[1062]: starting ...
> > 
> > Result of query trying to use it is:
> > 
> > nested: ElasticSearchIllegalArgumentEx\*\*ception[script\_lang not  
> > supported [python]]; }]","status":500}
> > 
> > What else do I need to do to support a Python script?
> > 
> > Thanks,  
> > Brandon

---

<div class="post-metadata">

**Author:** ![Brandon\_Hilkert](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_hilkert/32/2182_2.png) [@Brandon\_Hilkert](https://discuss.elastic.co/u/Brandon_Hilkert)\
**Post date:** [March 17, 2012, 1:37pm UTC](https://discuss.elastic.co/t/python-support-for-custom-score/7010/4 "2012-03-17T13:37:42Z")

</div>

Oops! Didn't realize homebrew still had an older version....Thanks!

On Friday, March 16, 2012 1:07:12 PM UTC-4, kimchy wrote:

> Check the readme:  
> [GitHub - elastic/elasticsearch-lang-python: Python language Plugin for elasticsearch](https://github.com/elasticsearch/elasticsearch-lang-python), 1.1.0 only  
> supports 0.19.0, not 0.18 version.
> 
> Just to add some clarification, here is the query:
> 
> > curl -X GET "[http://localhost:9200/employers/employer/\_search?pretty=true](http://localhost:9200/employers/employer/_search?pretty=true)"  
> > -d  
> > '{"query":{"custom\_score":{"params":{"param1":3},"script":"weight(param1)","lang":"python","query":{"query\_string":{"query":"fa\*"}}}}}'
> > 
> > On Wednesday, March 14, 2012 6:22:21 PM UTC-4, Brandon Hilkert wrote:
> > 
> > > I'm trying to use a python script to create a custom score. I installed  
> > > the plugin doing this:
> > > 
> > > bin/plugin -install elasticsearch/elasticsearch-\*\*lang-python/1.1.0
> > > 
> > > It seemed to work fine. When the server starts up, I get this:
> > > 
> > > 2012-03-14 18:18:33,103][INFO][node] [Grey King]  
> > > {0.18.7}[1062]: initializing ...  
> > > [2012-03-14 18:18:33,115][INFO][plugins] [Grey King]  
> > > loaded [lang-python], sites   
> > > [2012-03-14 18:18:34,294][WARN][script] [Grey King]  
> > > no script engine found for [py]  
> > > [2012-03-14 18:18:34,529][INFO][node] [Grey King]  
> > > {0.18.7}[1062]: initialized  
> > > [2012-03-14 18:18:34,529][INFO][node] [Grey King]  
> > > {0.18.7}[1062]: starting ...
> > > 
> > > Result of query trying to use it is:
> > > 
> > > nested: ElasticSearchIllegalArgumentEx\*\*ception[script\_lang not  
> > > supported [python]]; }]","status":500}
> > > 
> > > What else do I need to do to support a Python script?
> > > 
> > > Thanks,  
> > > Brandon

---

<div class="post-metadata">

**Author:** ![Eran\_Eidinger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eran_eidinger/32/44831_2.png) [@Eran\_Eidinger](https://discuss.elastic.co/u/Eran_Eidinger)\
**Post date:** [March 3, 2013, 8:30am UTC](https://discuss.elastic.co/t/python-support-for-custom-score/7010/5 "2013-03-03T08:30:21Z")

</div>

Excusse the newbie question, but...  
Where exactly should this bin/plugin -install elasticsearch/elasticsearch-lang-python/1.2.0. be run?  
do I need to git clone the repository? there is no "bin" folder there.

---

<div class="post-metadata">

**Author:** ![simonw\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonw_2/32/1130_2.png) [@simonw\_2](https://discuss.elastic.co/u/simonw_2)\
**Post date:** [March 3, 2013, 9:54am UTC](https://discuss.elastic.co/t/python-support-for-custom-score/7010/6 "2013-03-03T09:54:34Z")

</div>

you should run  
bin/plugin -install elasticsearch/elasticsearch-lang-python/1.2.0  
in the bin/ directory of you elasticsearch installation. if there is no bin  
folder there is something wrong. Make sure you get a copy from  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/download/) and unzip / tar it in order to  
install the plugin. you don't need to clone the plugin git repo.

simon

On Sunday, March 3, 2013 9:30:21 AM UTC+1, Eran wrote:

> Excusse the newbie question, but...  
> Where exactly should this bin/plugin -install  
> elasticsearch/elasticsearch-lang-python/1.2.0. be run?  
> do I need to git clone the repository? there is no "bin" folder there.
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/Python-support-for-custom-score-tp3827038p4030871.html](http://elasticsearch-users.115913.n3.nabble.com/Python-support-for-custom-score-tp3827038p4030871.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

--  
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:** ![Eran\_Eidinger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eran_eidinger/32/44831_2.png) [@Eran\_Eidinger](https://discuss.elastic.co/u/Eran_Eidinger)\
**Post date:** [March 3, 2013, 1:48pm UTC](https://discuss.elastic.co/t/python-support-for-custom-score/7010/7 "2013-03-03T13:48:53Z")

</div>

Thanks alot!

On Sun, Mar 3, 2013 at 11:54 AM, simonw-2 [via Elasticsearch Users] \<  
[ml-node+s115913n4030874h70@n3.nabble.com](mailto:ml-node+s115913n4030874h70@n3.nabble.com)\> wrote:

> you should run  
> bin/plugin -install elasticsearch/elasticsearch-lang-python/1.2.0  
> in the bin/ directory of you elasticsearch installation. if there is no  
> bin folder there is something wrong. Make sure you get a copy from  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/download/) and unzip / tar it in order to  
> install the plugin. you don't need to clone the plugin git repo.
> 
> simon
> 
> On Sunday, March 3, 2013 9:30:21 AM UTC+1, Eran wrote:
> 
> > Excusse the newbie question, but...  
> > Where exactly should this bin/plugin -install  
> > elasticsearch/elasticsearch-\*\*lang-python/1.2.0. be run?  
> > do I need to git clone the repository? there is no "bin" folder there.
> > 
> > --  
> > View this message in context: [http://elasticsearch-users](http://elasticsearch-users).\*\*  
> > [115913.n3.nabble.com/Python-](http://115913.n3.nabble.com/Python-) **support-for-custom-score-**  
> > tp3827038p4030871.html[http://elasticsearch-users.115913.n3.nabble.com/Python-support-for-custom-score-tp3827038p4030871.html](http://elasticsearch-users.115913.n3.nabble.com/Python-support-for-custom-score-tp3827038p4030871.html)  
> > Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).
> 
> --  
> 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 [hidden email][http://user/SendEmail.jtp?type=node&node=4030874&i=0](http://user/SendEmail.jtp?type=node&node=4030874&i=0)  
> .  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> * * *
> 
> If you reply to this email, your message will be added to the discussion  
> below:
> 
> [http://elasticsearch-users.115913.n3.nabble.com/Python-support-for-custom-score-tp3827038p4030874.html](http://elasticsearch-users.115913.n3.nabble.com/Python-support-for-custom-score-tp3827038p4030874.html)  
> To unsubscribe from Python support for custom score, click here[http://elasticsearch-users.115913.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe\_by\_code&node=3827038&code=ZXJhbmlkQGdtYWlsLmNvbXwzODI3MDM4fDY0MzA1NjE1MA==](http://elasticsearch-users.115913.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3827038&code=ZXJhbmlkQGdtYWlsLmNvbXwzODI3MDM4fDY0MzA1NjE1MA==)  
> .  
> NAML[http://elasticsearch-users.115913.n3.nabble.com/template/NamlServlet.jtp?macro=macro\_viewer&id=instant\_html!nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify\_subscribers!nabble%3Aemail.naml-instant\_emails!nabble%3Aemail.naml-send\_instant\_email!nabble%3Aemail.naml](http://elasticsearch-users.115913.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml)

---

<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:48am UTC](https://discuss.elastic.co/t/python-support-for-custom-score/7010/8 "2017-07-06T02:48:41Z")

</div>


