lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: Having an issue with pivot faceting
Date Thu, 09 Oct 2014 00:34:23 GMT

: Subject: Having an issue with pivot faceting

Ok - first off -- your example request doens't include any "facet.pivot" 
params, so you aren't using pivot faceting .. which makes me concerned 
that if you aren't using the feature you think you are, or don't 
understand the feature you are using.

: I'm having an issue getting pivot faceting working as expected.  I'm trying
: to filter by a specific criteria, and then first facet by one of my document
: attributes called item_generator, then facet those results into 2 sets each:
: the first set is the count of documents satisfying that facet with
: number_of_items_generated set to 0, the other set counting the documents
: satisfying that facet with number_of_items_generated greater than 0.  Seems

second:: interval faceting is just a fancy, more efficient, way of 
using "facet.query" if your queries are always over ranges.  there's 
nothing about interval faceting that is directly related to pivot 

third: there isn't currently any generic support for faceting by a field, 
and then facet "those results" by some other field/criteria.  This is 
actively being worked on in issues like SOLR-6348 - but it doens't exist 

fourth: because you ultimately have a specific citeria for how 
you want to divide the facets, something similar to the behavior you are 
asking is available using "taged exclusions" on facets....

...the basic idea you could follow is that you send additional fq params 
for each of the 2 criteria you want to lump things into 
(number_of_items_generated<0 and number_of_items_generated>0) but you tag 
those filters so they can individuall be "excluded" from facets -- then 
you use facet.field on your item_generator field twice (with different 
keys)  and in each case you exclude only one of those filters.

Here's a similar example to what you describe using the sample data that 
comes with solr...


so "cheap_cats" gives you facet counts on the "cat" field but only for the 
"cheap" products (because it excludes the "pricey" fq) and "pricey_cats" 
gives you facet counts on the "cat" field for the "pricey" products by 
excluding the "cheap" fq.

note however that the numFound is 0 -- this works fine for getting the 
facet counts you wnat, but you'd need a second query q/ the filters to get 
the main result set since (i'm pretty sure) it's not possible to use "ex" 
on the main query to exclude filters from affecting the main result set.


View raw message