I have the following query:
{
"selector":{
"lastname":{
"$regex":"(?i)[cç][oòóôõöø]"
},
"firstname":{
"$gt":null
},
"type":"person",
"owner":{
"$in":["admin"]
}
},"sort":["lastname","firstname"]
}
And tried many indexes:
{
"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"
}
]
}
}
But none worked. FYI I'm using CouchDB 2.1.0.
I also tried to add "sort":["lastname","firstname","type","owner"]
to the query. Still getting the warning: no matching index found, create an index to optimize query time
What am I doing wrong?
Edit: I'm using PouchDB directly to my CouchDB server (no sync), if that can help...