Phạm Quốc Bảo Phạm Quốc Bảo - 6 months ago 50
Node.js Question

Cloudant : Query search index with 2 paramters

I wan to call the API with 2 parameters: provider_id and id, but i don't know the structure to call. About 1 parameter, it's well. Could you give me advise for this? Thanks

this is structure to call API with 1 param.'allstaff', 'allstaff_index', {q:"provider_id:"+request.params.provider_id}, function(err, doc) {


The Cloudant search query syntax is based on the Lucene syntax.

The available logical operators are: AND, +, OR, NOT and -, and are case sensitive.

Your query will looks like

"provider_id:"+request.params.provider_id+" AND id:"

You can read more about in this tutorial.

Or watching this video

Best regards

Bernardo Baumblatt