我有一個Bluemix DB Cloudant與定義爲指數:查詢索引不會返回預期的數據
{
"index": {
"fields": [
{ "typ": "asc" },
{ "sen": "asc" },
{ "tim": "asc" }
]
},
"type": "json"
}
時,我有形式
{
"selector": {
"tim": {"$gt": millisecs},
"typ": "H"
},
"fields": ["sen","val","tim"],
"sort": [
{ "typ": "asc" },
{ "sen": "asc" },
{ "tim": "asc" }
],
"limit": readCount
}
它工作的查詢完美。如果我想要得到的一切,即刪除的條件typ="H"
,我得到的錯誤
「錯誤」:「no_usable_index」,「原因」:「有這個選擇沒有可用的指標。」
如果我有"typ" : { "$in": ["H", "T"] }
,我會得到相同的回答。我會期望更通用的查詢比帶額外選擇器的查詢更好。
我只是不明白這到底是怎麼!
查看評論:http://stackoverflow.com/questions/35385834/query-index-in-cloudant-doesnt-return-expected-data/35398907?noredirect=1#comment59781819_35398907 – Ilya