# Elasticsearch-py usage

**URL:** <https://discuss.elastic.co/t/elasticsearch-py-usage/16365>\
**Category:** Elasticsearch\
**Created:** [March 13, 2014, 8:57pm UTC](https://discuss.elastic.co/t/elasticsearch-py-usage/16365 "2014-03-13T20:57:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kent\_Tenney](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kent_tenney/32/1739_2.png) [@Kent\_Tenney](https://discuss.elastic.co/u/Kent_Tenney)\
**Post date:** [March 13, 2014, 8:57pm UTC](https://discuss.elastic.co/t/elasticsearch-py-usage/16365/1 "2014-03-13T20:57:55Z")

</div>

From the fsriver doc:

curl -XPUT 'localhost:9200/\_river/mydocs/\_meta' -d '{  
"type": "fs",  
"fs": {  
"url": "/tmp",  
"update\_rate": 900000,  
"includes": "_.doc,_.pdf",  
"excludes": "resume"  
}  
}'

How does this translate to the Python API?

Thanks,  
Kent

--  
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/CAAa\_k2f9zW7VLR5%3DjkqipQwzZanU%2BQxCDWSVJ0FD1L\_6RP6g7w%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAAa_k2f9zW7VLR5%3DjkqipQwzZanU%2BQxCDWSVJ0FD1L_6RP6g7w%40mail.gmail.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:** [March 13, 2014, 9:18pm UTC](https://discuss.elastic.co/t/elasticsearch-py-usage/16365/2 "2014-03-13T21:18:11Z")

</div>

Hello Kent,

you can always access the raw transport and send any request you wish  
for the unsupported APIs:

from elasticsearch import Elasticsearch  
es = Elasticsearch()  
data, status = es.transport.perform\_request('PUT', '/\_river/....',  
body={'type': 'fs',})

Hope this helps,

Honza Kral

On Thu, Mar 13, 2014 at 9:57 PM, Kent Tenney [ktenney@gmail.com](mailto:ktenney@gmail.com) wrote:

> From the fsriver doc:
> 
> curl -XPUT 'localhost:9200/\_river/mydocs/\_meta' -d '{  
> "type": "fs",  
> "fs": {  
> "url": "/tmp",  
> "update\_rate": 900000,  
> "includes": "_.doc,_.pdf",  
> "excludes": "resume"  
> }  
> }'
> 
> How does this translate to the Python API?
> 
> Thanks,  
> Kent
> 
> --  
> 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/CAAa\_k2f9zW7VLR5%3DjkqipQwzZanU%2BQxCDWSVJ0FD1L\_6RP6g7w%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAAa_k2f9zW7VLR5%3DjkqipQwzZanU%2BQxCDWSVJ0FD1L_6RP6g7w%40mail.gmail.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/CABfdDiod%2B59QVa9dtOT8TBSAtuHh8Zm\_ongDu-2vs%3DeZD-UcFw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CABfdDiod%2B59QVa9dtOT8TBSAtuHh8Zm_ongDu-2vs%3DeZD-UcFw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Josh\_Harrison](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@Josh\_Harrison](https://discuss.elastic.co/u/Josh_Harrison)\
**Post date:** [March 13, 2014, 9:20pm UTC](https://discuss.elastic.co/t/elasticsearch-py-usage/16365/3 "2014-03-13T21:20:31Z")

</div>

It doesn't look like the elasticsearch-py API covers the river use case.  
When I've run into things like this I've always just run a manual CURL  
request, or if I need to do it from within a script I just do a basic  
command with requests, ala  
requests.put("[http://localhost:9200/\_river/mydocs/\_meta](http://localhost:9200/_river/mydocs/_meta)" data='{"type":  
"fs", "fs": { "url": "/tmp", "update\_rate": 900000, "includes":  
"_.doc,_.pdf", "excludes": "resume" }}')  
Not the most elegant approach, but it works!

On Thursday, March 13, 2014 1:57:55 PM UTC-7, Kent Tenney wrote:

> From the fsriver doc:
> 
> curl -XPUT 'localhost:9200/\_river/mydocs/\_meta' -d '{  
> "type": "fs",  
> "fs": {  
> "url": "/tmp",  
> "update\_rate": 900000,  
> "includes": "_.doc,_.pdf",  
> "excludes": "resume"  
> }  
> }'
> 
> How does this translate to the Python API?
> 
> Thanks,  
> Kent

--  
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/c9d25008-fe3d-43dc-a57f-e8e510f8a3ce%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c9d25008-fe3d-43dc-a57f-e8e510f8a3ce%40googlegroups.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:43am UTC](https://discuss.elastic.co/t/elasticsearch-py-usage/16365/4 "2017-07-06T01:43:17Z")

</div>


