Closed espy closed 2 weeks ago
Just found this Nouveau API docs page which has the correct syntax, so I suppose the docs on the main Nouveau page are simply out of date.
I was just getting to this ticket. Yes, the nouveau syntax here is different. I will confirm it all works as documented now.
Thank you for the feedback btw, this is exactly the sort of thing I was hoping for in the first release. Hopefully it's all just little documentation oopsies...
Description
The range faceting syntax in the Nouveau docs doesn’t work. It describes the same ranges syntax as the ddocs search page, but this doesn’t actually work with Nouveau.
I’m not sure whether the Nouveau docs are wrong, or Nouveau is missing the intended implementation. There is a working syntax described elsewhere.
In addition, this other working syntax has confusing defaults for inclusive/exclusive range facets (described further below).
Steps to Reproduce
In a CouchDB with activated Nouveau, with a running Nouveau server:
rating: 8.1
double
index for that key:Send a ranges query as described in the Nouveau Docs, but without using
Infinity
, because that also doesn’t work as documented, see this issue:Taken from the docs:
…adapted to use our data and
10
instead ofInfinity
:As JSON, for readability:
Turning the query into a list of objects doesn’t work though. What does work is the syntax found in this Nouveau README.md:
as JSON, for readability:
This returns a result:
Now, you’ll notice that the total count in the facets is more than the
total_hits
(25 vs 23), this is because the rating8
falls into both facets, so all hits with a rating of8
are counted twice. The Nouveau implementation of ranges can also usemin_inclusive
andmax_inclusive
boolean keys, which (to me) implies thatmin
andmax
are by default exclusive, however we just saw they aren’t:8
is included in bothmin
andmax
, and the default for both booleans is actuallytrue
.Using
min_inclusive
andmax_inclusive
does then work. Assigning the8
to theamazing
facet like so:returns:
Expected Behaviour
I expected the example in the docs to work.
Your Environment