Speeding up my cloudant query
<p>I was wondering whether someone could provide some advice on my cloudant query below. It is now taking upwards of 20 seconds to execute against a DB of 50,000 documents - I suspect I could be getting better speed than this.</p>

<p>The purpose of the query is to find all of my documents with the attribute "searchCode" equalling a specific value plus a further list of specific IDs.</p>

<p>Both searchCode and _id are indexed - any ideas why my query would be taking so long / what I could do to speed it up?</p>

<pre><code>mydb.find({selector: {"$or":[{"searchCode": searchCode},{"_id":{"$in":idList}}]}}, function (err, result) {
   if(!err){
      fulfill(result.docs);
   }
   else{
      console.error(err);
   }
});
</code></pre>

<p>Thanks,
James</p>