Null as match sort of deal

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Null as match sort of deal

Corey Tisdale-3
I'm scoping out the simple faceting for a project we have coming up,  
and I am wondering what the best way to achieve the following would  
be (if possible). We have some facets where the presence of some  
value (in our current prototype on non-solr we use null, so we call  
the setup null as match :) constitutes a hit all of the time (where  
facet=x or facet=null) and on some facets constitutes a not match  
(facet=x only). Can out of the box solr faceting support something  
like this, or can it be done with a light massaging?

Thanks!
Corey
Reply | Threaded
Open this post in threaded view
|

Re: Null as match sort of deal

Chris Hostetter-3

: be (if possible). We have some facets where the presence of some
: value (in our current prototype on non-solr we use null, so we call
: the setup null as match :) constitutes a hit all of the time (where
: facet=x or facet=null) and on some facets constitutes a not match
: (facet=x only). Can out of the box solr faceting support something
: like this, or can it be done with a light massaging?

it would certainly be doable in a custom request handler ... you would
want to generate a DocSet of all documents that match your sentinle value
(ie: "null") and then union that with each of the DocSets from your
constraints before intersecting with the DocSet from your main search to
get the counts.

alternately, if you know that your fields are "single value" you could
probably just find the intersection of your main DocSet with the DocSet of
things matching the sentinal value, and then add that number to each of
your constraint intersections ... that should be the same number,
correct?


-Hoss