Multi-field Facet Is it possible not double count documents?

Looks like a multi-field facet counting matches rather than documents
resulting in double-counting documents. Is it possible to control this
behavior? Wold be nice to have a flag in facet def. to select desired
behavior - it could be very confusing in some use cases to have more
matches on a facet than you have documents.

Thank you,
Alex

--

You can use a script field with the terms facet where the script is
the aggregation of the two fields.

--
Ivan

On Tue, Jan 22, 2013 at 1:31 PM, AlexR roytmana@gmail.com wrote:

Looks like a multi-field facet counting matches rather than documents
resulting in double-counting documents. Is it possible to control this
behavior? Wold be nice to have a flag in facet def. to select desired
behavior - it could be very confusing in some use cases to have more
matches on a facet than you have documents.

Thank you,
Alex

--

--

Thank you Ivan but wouldn't I get a big hit on performance? Simple term
facet I assume is evaluated using inverted index while script based faced
will be evaluated by loading and faceting every document. In any case
ability to double or not-double counting would be a very helpful feature to
have. I would say not double-counting seems to be a more common need then
the opposite

On Tue, Jan 22, 2013 at 5:18 PM, Ivan Brusic ivan@brusic.com wrote:

You can use a script field with the terms facet where the script is
the aggregation of the two fields.

--
Ivan

On Tue, Jan 22, 2013 at 1:31 PM, AlexR roytmana@gmail.com wrote:

Looks like a multi-field facet counting matches rather than documents
resulting in double-counting documents. Is it possible to control this
behavior? Wold be nice to have a flag in facet def. to select desired
behavior - it could be very confusing in some use cases to have more
matches on a facet than you have documents.

Thank you,
Alex

--

--

--

That's odd. I tought a facet count was always made per doc.
Could it be that your facet is a nested facet? In witch case the count
would be made by sub-doc, thus resulting in a total greater than your
number of docs. (If I am not mistaken)

Le mardi 22 janvier 2013 22:31:57 UTC+1, AlexR a écrit :

Looks like a multi-field facet counting matches rather than documents
resulting in double-counting documents. Is it possible to control this
behavior? Wold be nice to have a flag in facet def. to select desired
behavior - it could be very confusing in some use cases to have more
matches on a facet than you have documents.

Thank you,
Alex

--

Actually I do not know if it does. I am very new to ES. I just assumed it takes number of top teems and finds counts for them because queries with large result set did mot seem ti be much slower than smal ones. I need to eead up on lucine stoeage organization...

--