Elasticsearch-py usage

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.
To view this discussion on the web visit 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.

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 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.
To view this discussion on the web visit 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.

--
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.
To view this discussion on the web visit 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.

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" 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/c9d25008-fe3d-43dc-a57f-e8e510f8a3ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.