: say I have a parameter facet.field=STATE. For example we'll take 3D
: faceting, so I'll need 2 more facet fields related to the first one.
: Should we do something like this:
: facet.field=STATE&f.STATE.facet.matrix=NAME&f.STATE.facet.matrix=INCOME
: Or for example we can have may be like this:
: facet.matrix=STATE,NAME,INCOME
: What would you suggest is better?
It's not something i've thought about too hard, but i was thinking along
the line of the first example. So STATE is the main facet for the matrix,
and the other facets are identified as values of the f.STATE.facet.matrix
param ("matrix" isn't really the best word, it's more like a tre of
facet values ... for each of the top N values in the "main" facet, you
also get the top N values of the other facets listed).
That way you could have multiple fracet trees, and a single facet could
be part of more then one tree, it just couldn't be the main facet of
more then one tree. for example, imagine we want to facet cars...
facet.limit=10 &
facet.field=STATE &
facet.field=MODEL & f.MODEL.facet.tree=COLOR & f.MODEL.facet.tree=YEAR &
facet.field=TYPE & f.TYPE.facet.tree=COLOR & f.TYPE.facet.tree=STATE
...that would give you completley independent facet counts for STATE,
MODEL, and TYPE, but it would also tell you what the type 10 COLORs and
YEARs are for each of the top 10 MODELs, and what the top 10 COLORs and
STATEs are for each TYPE of car (even if not enough cars are in that state
to show up in the main STATE facet)
...honestly: any permutation you want is possible, it's jsut a question of
how to express it cleanly in key=val pair style input so it's easy to
express over HTTP.
: Also, where in Solr I could find something similar to take it as an
: example? Where all this logic should be placed?
the logic could o in a custom RequestHandler, or a custom Component ... if
you look at the FacetComponent class in the nightly builds of Solr you can
see how the current Simple faceting code is handled ... the underlying
methods (for getting counts using DocSet intersections) can still be
reused, you just need to pass them additional "filter" DocSets from the
"main" facet.
-Hoss