我有以下查询:
{
"selector":{
"lastname":{
"$regex":"(?i)[cç][oòóôõöø]"
},
"firstname":{
"$gt":null
},
"type":"person",
"owner":{
"$in":["admin"]
}
},"sort":["lastname","firstname"]
}
并尝试了许多索引:
{
"type": "json",
"def": {
"fields": [
{
"lastname": "asc"
}
]
}
}
{
"type": "json",
"def": {
"fields": [
{
"lastname": "asc"
},
{
"firstname": "asc"
}
]
}
}
{
"type": "json",
"def": {
"fields": [
{
"lastname": "asc"
},
{
"firstname": "asc"
},
{
"type": "asc"
},
{
"owner": "asc"
}
]
}
}
但没有一个奏效。仅供参考,我正在使用 CouchDB 2.1.0。
我也尝试添加"sort":["lastname","firstname","type","owner"]
到查询中。仍然收到警告:no matching index found, create an index to optimize query time
我究竟做错了什么?
编辑:我将 PouchDB 直接用于我的 CouchDB 服务器(不同步),如果这可以帮助...