Nested type and range facet


(Dan Everton) #1

Howdy,

I'm trying to do a query with a range facet that has the key field come from
the parent document and the value field values come from all nested
documents. Here's a gist of the idea

What I'm hoping for is to have each rating range facet have the min, max,
average, etc of the prices within the nested document of the matching
containing document.

Now that I look at it again at the nested facet documentation, I'm thinking
this isn't possible, but I'd loved to be proved wrong.

Cheers,
Dan


(Shay Banon) #2

This is not possible, but, what you can do is set include_in_parent on the
nested mapping, which will cause the values to also be indexed in the parent
doc. The range facet supports cases with single key multiple values per doc.

On Fri, Aug 5, 2011 at 6:43 AM, Dan Everton dan@iocaine.org wrote:

Howdy,

I'm trying to do a query with a range facet that has the key field come
from the parent document and the value field values come from all nested
documents. Here's a gist of the idea

https://gist.github.com/1126866

What I'm hoping for is to have each rating range facet have the min, max,
average, etc of the prices within the nested document of the matching
containing document.

Now that I look at it again at the nested facet documentation, I'm thinking
this isn't possible, but I'd loved to be proved wrong.

Cheers,
Dan


(Dan Everton) #3

Okay, yeah, that makes sense. Kind of blows out the index size a bit, but it
works.


(Shay Banon) #4

In theory, we can support this case for facets, though with a lot of more
coding... . Open an issue for this so we won't forget.

On Mon, Aug 8, 2011 at 1:47 AM, Dan Everton dan@iocaine.org wrote:

Okay, yeah, that makes sense. Kind of blows out the index size a bit, but
it works.


(system) #5