You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Jay Luker <lb...@reallywow.com> on 2012/12/17 23:12:24 UTC

Multiple facet.prefix's?

Hi,

Has the functionality discussed at
http://lucene.472066.n3.nabble.com/Multiple-facet-prefix-td525473.html ever
been implemented in a different way? I've tried the
"facet.field={!prefix=foo prefix=bar}myfield" syntax that was decided upon
and it doesn't seem to work.

I have a pair of multi-valued index fields, "author" and "author_norm", and
I've created a hierarchical facet field for them using the pattern
described at https://wiki.apache.org/solr/HierarchicalFaceting#Indexed_Terms.
The facet values look like this, where "author_norm" is the 0/ level and
the un-normalized "author" is level 1/.

    0/Blow, J
    1/Blow, J/Blow, Joe
    1/Blow, J/Blow, Joseph
    1/Blow, J/Blow, Jennifer
    0/Smith, M
    1/Smith, M/Smith, Michelle
    1/Smith, M/Smith, Michael
    1/Smith, M/Smith, Mike

Authors are associated to article records, and in most cases an article
will have many authors. This means that for a Solr query that returns 100+
articles, there will potentially be 1000+ authors represented.

My problem is that when I go to display this hierarchy to the user I do not
have the complete set of 1/ values, i.e., the 2nd level of my hierarchy
will be cut-off at a certain point. I will have something like this:

* Blow, J (30)
    * Blow, Joe (17)
    * Blow, Joseph (9)
* Smith, M (22)
    * Smith, Michelle (14)
    * Smith, Michael (6)

I would like to also have the "Blow, Jennifer (4)" and "Smith, Mike (2)"
entries in this list, but they're not returned in the response because
they're outside either the facet.limit or facet.mincount cutoffs.

I'm assuming I need to do some kind of follow-up query, but so far I
haven't come up with anything that doesn't require N additional requests if
I want to display the top N authors + all their un-normalized variations.
e.g., doing "&facet.prefix=1/Blow,+J" ten times, once for each author.

I think the ability to specify multiple facet.prefix's, as discussed in the
thread linked-to above, would satisfy by allowing something like
"facet.field={!prefx="Blow, J" prefix="Smith, M" ...}author_hier".

I can't imagine this is a unique problem. Has anyone else come up against
this, and what did you do?

Thanks!