Facet search and missing values

Hi there.

Firstly: ES is a great piece of software. Many thanks!

I am using the term_stats facets to sum the value of a field 'grouped by' a
facet key. Not all records in the index have a value for this facet key.

The only problem is dealing with these 'empty' facet keys.

By default, I get a histogram of available facet keys and sum(count).
However the question is how to work out sum(count) for those records
without the facet key?

If I were using a simple counting (term) facet (as opposed to term_stats
with a sum) I could use the 'missing' value that is returned. However, that
does not help as I need the sum(count field) for the missing records.

Possible?

Ideally it would be possible to:

  • Ask ES to sum the count field for the records without that facet field
    and return as missing_total
  • (Maybe cleaner) Signal that I would like ES to consider a virtual
    'MISSING' facet that gets stats applied, ranked and returned if applicable.

Does that make sense?

Many thanks

--

That sounds like a good idea. Could you create an issue for it?

On Friday, November 2, 2012 4:47:48 AM UTC-4, Alastair James wrote:

Hi there.

Firstly: ES is a great piece of software. Many thanks!

I am using the term_stats facets to sum the value of a field 'grouped by'
a facet key. Not all records in the index have a value for this facet key.

The only problem is dealing with these 'empty' facet keys.

By default, I get a histogram of available facet keys and sum(count).
However the question is how to work out sum(count) for those records
without the facet key?

If I were using a simple counting (term) facet (as opposed to term_stats
with a sum) I could use the 'missing' value that is returned. However, that
does not help as I need the sum(count field) for the missing records.

Possible?

Ideally it would be possible to:

  • Ask ES to sum the count field for the records without that facet field
    and return as missing_total
  • (Maybe cleaner) Signal that I would like ES to consider a virtual
    'MISSING' facet that gets stats applied, ranked and returned if applicable.

Does that make sense?

Many thanks

--

Sure... on gtihub?

--

Yes, this way we will not forget about it and you will get a notification
when it's done.

On Friday, November 2, 2012 3:39:39 PM UTC-4, Alastair James wrote:

Sure... on gtihub?

--

Ok, great, thanks. Created

On Friday, 2 November 2012 19:44:03 UTC, Igor Motov wrote:

Yes, this way we will not forget about it and you will get a notification
when it's done.

On Friday, November 2, 2012 3:39:39 PM UTC-4, Alastair James wrote:

Sure... on gtihub?

--