Hi Shalin,

thanks for taking your time (reading it twice!).

Rephrasing the question:
(suppose mincount=0 and facet.limit > all possible facet values)

Currently, the facet results include ALL values for that facet field.
Say I have a field color and when I look at the statistics (LUKE), I can see that my index contains altogether 7 different colors. This is comparable to a group/count/distinct query in a SQL db.

Querying for "color" as facet field with mincount=0 should thus return 7 facet fields with various count results. This fact (7 different counts returned for "color") will not change no matter what the query (q) or the filter queries (fq) are - unless I change mincount.

Is that correct?

If so, then I was considering the cases why a facet count would be 0 (always suppose mincount=0).

Case 1) No hit as defined by the query (q parameter) contains that specific facet value (e.g. the colors blue and green). Case 2) This is like Case (1) but there is a filterquery on top, that excludes certain values from the facet field, so even before q is executed, it's clear that certain facet values are 0. (e.g. the filter includes only hits with colors yellow and orange. So, by this filter, documents with the colors blue and green are already excluded from the set that is considered for the actual query (q).) For me, this results in two different flavours of "0" counts: either the 0 is the result of executing the query (q) or a result of a filterquery.

Now, I was wondering whether it is possible to find that out. It would allow to show 0 counts of values that are produced by the query (q), and at the same time exclude all facet values that are already excluded by the filter query.

Applying facetting to a subset (subselect / filterset) of the index not to everything - that might describe it, as well.


Does that make sense?
Thanks,
Chantal


Shalin Shekhar Mangar schrieb:
On Wed, Jan 13, 2010 at 4:55 PM, Chantal Ackermann <
chantal.ackerm...@btelligent.de> wrote:

Hi all,

is it possible to restrict the returned facets to only those that apply to
the filter query but still use mincount=0? Keeping those that have a count
of 0 but apply to the filter, and at the same time leaving out those that
are not covered by the filter (and thus 0, as well).

Some longer explanation of the question:

Example (don't nail me down on biology here, it's just for illustration):
q=type:mammal&facet.mincount=0&facet.field=type

returns facets for all values stored in the field "type". Results would
look like:

mammal(2123)
bird(0)
dinosaur(0)
fish(0)
...

In this case setting facet.mincount=1 solves the problem. But consider:

q=area:water&fq=type:mammal&facet.field=name&facet.mincount=0

would return something like
dolphin (20)
blue whale (20)
salmon (0) <= not covered by filter query
lion (0)
dog (0)
... (all sorts of animals, every possible value in field "name")

My question is: how can I exclude those facets from the result that are not
covered by the filter query. In this example: how can I exclude the
non-mammals from the facets but keep all those mammals that are not matched
by the actual query parameter?


I've read this twice but the problem is still not clear to me. I guess you
will have to explain it better to get a meaningful response.

--
Regards,
Shalin Shekhar Mangar.

Reply via email to