dismax and facets with constraints

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

dismax and facets with constraints

Brian Lucas
I'm experimenting with dismax to do faceted browsing, and when I add a
constraint with dismax on that facet, I no longer get the entire
facet-count.

 

i.e.

 

q=blah&qt=dismax&fq=type_id:1&hl=true&hl.fl=title+summary&hl.snippets=3&face
t=true&facet.limit=-1&facet.zeros=false&facet.field=type_id

 

<lst name="facet_counts">

<lst name="facet_queries"/>

            <lst name="facet_fields">

            <lst name="type_id">

<int name="2">95</int>

</lst>

</lst>

</lst>

 

 

I understand why this is happening, but is there another way to add a
constraint via querystring (instead of 'fq=type_id:1') and still get the
full facet-counts list?

 

I can do it with standardrequest, but then it doesn't appear like I can sort
the results.

 

 

Reply | Threaded
Open this post in threaded view
|

RE: dismax and facets with constraints

Brian Lucas
Just to clarify on this point, I am using highlighting in standardquery.
When I add a constraint and sort by a field, the highlighting function no
longer works.  Possible bug or user error?

 

  _____  

 

I can do it with standardrequest, but then it doesn't appear like I can sort
the results.

 

 

Reply | Threaded
Open this post in threaded view
|

Re: dismax and facets with constraints

Chris Hostetter-3
In reply to this post by Brian Lucas
: I'm experimenting with dismax to do faceted browsing, and when I add a
: constraint with dismax on that facet, I no longer get the entire
: facet-count.

that sounds expected ... when you add a constraint using "fq" (or adding
new clauses to the main query) the overall result set is going to get
smaller, and the counts are going ot be affected ... this is typically
what people want when they do faceted searching -- as they drill down the
counts should reflect their narrowed few of the world.  If they didn't
change, then you would have missleading info about the options available
to you.

if you really want "global" counts for the search, independent of the
constraints applied, just do two queries, one with and one without

One thing that confuses me though...

: q=blah&qt=dismax&fq=type_id:1&hl=true&hl.fl=title+summary&hl.snippets=3&face
: t=true&facet.limit=-1&facet.zeros=false&facet.field=type_id
        ...
: <lst name="facet_counts">
: <lst name="facet_queries"/>
:             <lst name="facet_fields">
:             <lst name="type_id">
: <int name="2">95</int>
: </lst>
: </lst>
: </lst>

that URL doesn't seem to jive with that response, if you've constraint to
type_id:1 your type_id facet count list should contain "1" ... it might
also contain "2" if type_id is a multivalue field and there are some docs
that have both "1" and "2", but i can't figure out why you only have a "2"
there ... does that URL really match what you are getting back from Solr,
or is this a cut/paste mistake?



-Hoss

Reply | Threaded
Open this post in threaded view
|

RE: dismax and facets with constraints

Chris Hostetter-3
In reply to this post by Brian Lucas

: Just to clarify on this point, I am using highlighting in standardquery.
: When I add a constraint and sort by a field, the highlighting function no
: longer works.  Possible bug or user error?

: I can do it with standardrequest, but then it doesn't appear like I can sort
: the results.

this sounds like it's unrelated to the facet counts issue ... but i'm
having trouble following what you mean, can you give us an example URL and
the output that you are getting from it (preferably using the example
schema/docs -- but we might be able to help even if it's your own custom
schema/data)



-Hoss