简体   繁体   中英

Cloudant search index limit 200

I know that the results of query search index have a limit of 200 rows.

Exist any way to view all docs matches?

I'm write in Python with Python Cloudant API and I need all rows for search using Search Index .

I want to know if I can do this using Search Index before using views or querys directly.

The result of query all data is:

{ "total_rows":1239, "bookmark":"g1AAAAJveJzLYWBg4MhgTmHQTElKzi9KdUhJMtRLytVNTtYtLdYtzi8tydA1MNRLzskvTUnMK9HLSy3JAWphSmRIkv___39WBpOb_QcGMEhkRjXHnBhzkhSAZJI9ulFMIKO0EE4iyk1JDiCz4gmZZUCUWQkgs-qxmkViUOWxgLQ2ACmgafPxGUdUiEGMWwAxbj_loQYx7wDEvPuUhxzEvAcQ89BCLwsAMoq9cQ", "rows":[...] }

And the length of "rows" is defined by limit parameter, but this max limit is 200.

How can I see all rows of my query?.

Thanks.

If you got your response with the following query:

https://$ACCOUNT.cloudant.com/$DATABASE/_design/$DDOC/_search/$INDEX_NAME?limit=200

You would get the next 200 rows with this query:

https://$ACCOUNT.cloudant.com/$DATABASE/_design/$DDOC/_search/$INDEX_NAME?limit=200&bookmark="g1AAAAJveJzLYWBg4MhgTmHQTElKzi9KdUhJMtRLytVNTtYtLdYtzi8tydA1MNRLzskvTUnMK9HLSy3JAWphSmRIkv___39WBpOb_QcGMEhkRjXHnBhzkhSAZJI9ulFMIKO0EE4iyk1JDiCz4gmZZUCUWQkgs-qxmkViUOWxgLQ2ACmgafPxGUdUiEGMWwAxbj_loQYx7wDEvPuUhxzEvAcQ89BCLwsAMoq9cQ"

To get all the documents for your query, write a function that recursively queries the database with the bookmark value coming from the previous response each time. Do this until your response has less than 200 documents, which is how you know you're done.

Full documentation on querying a Cloudant search index is here: https://console.bluemix.net/docs/services/Cloudant/api/search.html#queries

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM