# Python ES and Carrot2

**URL:** <https://discuss.elastic.co/t/python-es-and-carrot2/17122>\
**Category:** Elasticsearch\
**Created:** [April 22, 2014, 9:00am UTC](https://discuss.elastic.co/t/python-es-and-carrot2/17122 "2014-04-22T09:00:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pratik\_Poddar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pratik_poddar/32/1529_2.png) [@Pratik\_Poddar](https://discuss.elastic.co/u/Pratik_Poddar)\
**Post date:** [April 22, 2014, 9:00am UTC](https://discuss.elastic.co/t/python-es-and-carrot2/17122/1 "2014-04-22T09:00:52Z")

</div>

Stackoverflow link:

> <https://stackoverflow.com/questions/23047976/python-elasticsearch-and-carrot>

I am using python elastic search and I need to do document clustering. I  
have installed carrot2 ([https://github.com/carrot2/elasticsearch-carrot2](https://github.com/carrot2/elasticsearch-carrot2) ).

How do I call the carrot clustering module from python after

from elasticsearch import Elasticsearch  
es = Elasticsearch()  
es.search(.....)

REST api works but I need to do it using pyelasticsearch. Thanks

--  
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/aca90ff6-c0a7-42cb-ab8c-c1d83ada3146%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/aca90ff6-c0a7-42cb-ab8c-c1d83ada3146%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [April 22, 2014, 12:25pm UTC](https://discuss.elastic.co/t/python-es-and-carrot2/17122/2 "2014-04-22T12:25:54Z")

</div>

Hi Pratik,

if you are using elasticsearch-py you can call any API by using:  
es.transport.perform\_request (0) directly, that will enable you to use  
the carrot2 plugin:

es.transport.perform\_request('POST',  
'/test/test/\_search\_with\_clustering', body={"search\_request": ...})

Hope this helps,  
Honza

0 - [Connection Layer API — Elasticsearch 8.0.0 documentation](http://elasticsearch-py.readthedocs.org/en/master/connection.html#elasticsearch.Transport.perform_request)

On Tue, Apr 22, 2014 at 11:00 AM, Pratik Poddar [pratik.phodu@gmail.com](mailto:pratik.phodu@gmail.com) wrote:

> Stackoverflow link:  
> [carrot2 - Python Elasticsearch and Carrot - Stack Overflow](http://stackoverflow.com/questions/23047976/python-elasticsearch-and-carrot)
> 
> I am using python Elasticsearch and I need to do document clustering. I  
> have installed carrot2 ([GitHub - carrot2/elasticsearch-carrot2: Carrot2 plugin for ElasticSearch](https://github.com/carrot2/elasticsearch-carrot2) ).
> 
> How do I call the carrot clustering module from python after
> 
> from elasticsearch import Elasticsearch  
> es = Elasticsearch()  
> es.search(.....)
> 
> REST api works but I need to do it using pyelasticsearch. Thanks
> 
> --  
> 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/aca90ff6-c0a7-42cb-ab8c-c1d83ada3146%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/aca90ff6-c0a7-42cb-ab8c-c1d83ada3146%40googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CABfdDirQRShx0OygiEniDBaRjewu9w7BStL1Qnp3QZDOWq0sVA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CABfdDirQRShx0OygiEniDBaRjewu9w7BStL1Qnp3QZDOWq0sVA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Pratik\_Poddar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pratik_poddar/32/1529_2.png) [@Pratik\_Poddar](https://discuss.elastic.co/u/Pratik_Poddar)\
**Post date:** [April 23, 2014, 8:33pm UTC](https://discuss.elastic.co/t/python-es-and-carrot2/17122/3 "2014-04-23T20:33:26Z")

</div>

Thanks a ton.

On Tue, Apr 22, 2014 at 5:55 PM, Honza Král [honza.kral@elasticsearch.com](mailto:honza.kral@elasticsearch.com)wrote:

> Hi Pratik,
> 
> if you are using elasticsearch-py you can call any API by using:  
> es.transport.perform\_request (0) directly, that will enable you to use  
> the carrot2 plugin:
> 
> es.transport.perform\_request('POST',  
> '/test/test/\_search\_with\_clustering', body={"search\_request": ...})
> 
> Hope this helps,  
> Honza
> 
> 0 -  
> [Connection Layer API — Elasticsearch 8.0.0 documentation](http://elasticsearch-py.readthedocs.org/en/master/connection.html#elasticsearch.Transport.perform_request)
> 
> On Tue, Apr 22, 2014 at 11:00 AM, Pratik Poddar [pratik.phodu@gmail.com](mailto:pratik.phodu@gmail.com)  
> wrote:
> 
> > Stackoverflow link:
> 
> [carrot2 - Python Elasticsearch and Carrot - Stack Overflow](http://stackoverflow.com/questions/23047976/python-elasticsearch-and-carrot)
> 
> > I am using python Elasticsearch and I need to do document clustering. I  
> > have installed carrot2 ([GitHub - carrot2/elasticsearch-carrot2: Carrot2 plugin for ElasticSearch](https://github.com/carrot2/elasticsearch-carrot2)).
> > 
> > How do I call the carrot clustering module from python after
> > 
> > from elasticsearch import Elasticsearch  
> > es = Elasticsearch()  
> > es.search(.....)
> > 
> > REST api works but I need to do it using pyelasticsearch. Thanks
> > 
> > --  
> > 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/aca90ff6-c0a7-42cb-ab8c-c1d83ada3146%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/aca90ff6-c0a7-42cb-ab8c-c1d83ada3146%40googlegroups.com)  
> .
> 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> 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/me8mVYhhB-Q/unsubscribe](https://groups.google.com/d/topic/elasticsearch/me8mVYhhB-Q/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/CABfdDirQRShx0OygiEniDBaRjewu9w7BStL1Qnp3QZDOWq0sVA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CABfdDirQRShx0OygiEniDBaRjewu9w7BStL1Qnp3QZDOWq0sVA%40mail.gmail.com)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
Pratik Poddar  
[www.linkedin.com/in/pratikpoddar](http://www.linkedin.com/in/pratikpoddar)

> **[CseBlog.com is for sale | HugeDomains](https://www.hugedomains.com/domain_profile.cfm?d=cseblog.com)**
>
> Choosing the right domain name can be overwhelming. Our personalized customer service helps you get a great domain.

> **[Pratik Poddar's Web Space](https://pratikpoddar.wordpress.com/)**
>
> Visit the post for more.

--  
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/CAFiYsPdu7z5Y1n70a%2B7w-t%3D\_7HDREJJOe4R6TiT2M7dSX1zAqQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAFiYsPdu7z5Y1n70a%2B7w-t%3D_7HDREJJOe4R6TiT2M7dSX1zAqQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:33am UTC](https://discuss.elastic.co/t/python-es-and-carrot2/17122/4 "2017-07-06T01:33:57Z")

</div>


