Strange results from partial query strings using startkey and endkey


#1

I’m having a hard time understanding how partial query strings works in Couchbase, maybe it’s a bug.
The results are totally random.

I’m testing through the web interface, using the brewery beers bucket.

Some example I tried:
startkey=[“3_”]
Return all document starting from 3_fonteinen_brouwerij_ambachtelijke_geuzestekerij, which is the right result.
Then I tried startkey=[“fonteinen”]
I was expecting 0 result, instead I got all records starting from foothills_brewing_company.
What? What’s the rationale behind this?

Then I tried
?inclusive_end=true&startkey=[“zea_”]
Which return all docs from zea_rotisserie_and_brewery, seem ok.
But if I do:
?inclusive_end=true&startkey=[“zea_”]&endkey=[“z”]
I get "No rows can match your key range"
Uh, Why?!
If I call ?inclusive_end=true&startkey=[“zea_”]&endkey=[“zea_”]
The result is :
{“total_rows”:7303,“rows”:[
]
}
But if I query ?inclusive_end=true&startkey=[“zea_”]&endkey=[“zea_rotisserie_and_brewery”]
{“total_rows”:7303,“rows”:[
{“id”:“zea_rotisserie_and_brewery”,“key”:[“zea_rotisserie_and_brewery”],“value”:null}
]
}

I really can’t make out a pattern from this, and the documentation doesn’t help. Is it a bug?
I am using community edition, version 3.0.1.