richardwilly98 / elasticsearch-river-mongodb

MongoDB River Plugin for ElasticSearch
1.12k stars 215 forks source link

Listing more than 10 Rivers #495

Closed levofski closed 9 years ago

levofski commented 9 years ago

I see that the /_river/mongodb/list endpoint is limited to 10 results, however we have more than 10 rivers.

I have checked in https://github.com/richardwilly98/elasticsearch-river-mongodb/blob/master/src/main/java/org/elasticsearch/rest/action/mongodb/RestMongoDBRiverAction.java and I can see that I can send params for the page number and page size, but I cannot work out how.

http://192.168.20.31:9200/_river/mongodb/list?page=2 returns :-

{"success":false,"error":"action not found: /_river/mongodb/list?page=2"}

I have also tried an extended GET :-

curl -X GET -d '{"page":3}' http://192.168.20.31:9200/_river/mongodb/list

Please help

ewgRa commented 9 years ago

Try curl -XGET -G "http://host:9200/_river/mongodb/list" -d 'page=2'

levofski commented 9 years ago

Hi, I tried that command and it returned :-

{"success":false,"error":"action not found: /_river/mongodb/list?page=2"}

ewgRa commented 9 years ago

Can you show command and output?

levofski commented 9 years ago

Sure, here you go :-

root@foolsgold:~# curl -XGET -G "http://192.168.20.31:9200/_river/mongodb/list" -d 'page=2' {"success":false,"error":"action not found: /_river/mongodb/list?page=2"} root@foolsgold:~#

levofski commented 9 years ago

This seems to be closer, but still returns the first page :-

curl -X GET -d 'page=2' http://192.168.20.31:9200/_river/mongodb/list

ewgRa commented 9 years ago

For me even this work:

curl -XGET "http://localhost:9200/_river/mongodb/list?page=1" {"hits":0,"results":[],"count":0,"page":1,"pages":0.0}

Can you try load it from browser? http://localhost:9200/_river/mongodb/list?page=1

Also as which one versions you have? ES, plugins?

levofski commented 9 years ago

For me :-

http://192.168.20.31:9200/_river/mongodb/list?page=1 returns

{"success":false,"error":"action not found: /_river/mongodb/list?page=1"}

This is on ElasticSearch version 1.2.2 and river plugin version 2.0.1

ewgRa commented 9 years ago

I have ES 1.4.2, river - 2.0.6, and it works. Consider ability to upgrade your software.

levofski commented 9 years ago

Ok thanks for your time.

ewgRa commented 9 years ago

Maybe this help?

https://github.com/richardwilly98/elasticsearch-river-mongodb/blob/elasticsearch-river-mongodb-2.0.1/src/main/java/org/elasticsearch/rest/action/mongodb/RestMongoDBRiverAction.java

Check code for your version, there is different naming of params.

levofski commented 9 years ago

Thanks for that, however I am still getting the same errors if I change the param names.

ewgRa commented 9 years ago

Another one way, try debug ajax requests, that http://localhost:9200/_plugin/river-mongodb/ make. I don't know about 2.0.1 version, but in 2.0.6 it request list of rivers and allow to navigate between list pages. Try to reproduce this requests. Chrome even can copy it request as curl request.

Good luck! And better to upgrade.