Phạm Quốc Bảo Phạm Quốc Bảo - 1 year ago 83
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) {

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download