Dear Wiki user, You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.
The following page has been changed by YonikSeeley: http://wiki.apache.org/solr/SimpleFacetParameters The comment on the change is: filter tagging and exclusion during faceting ------------------------------------------------------------------------------ This parameter can be specified on a per field basis. In addition to the {{{all}}} option, this parameter can be specified multiple times to indicate multiple choices -- but {{{none}}} will override all other options. + + == LocalParams for faceting == + <!> ["Solr1.4"] + The LocalParams syntax provides a method of adding meta-data to other parameter values, much like XML attributes. + + === Tagging and excluding Filters === + One can tag specific filters and exclude those filters when faceting. This is generally needed when doing multi-select faceting. + + Consider the following example query with faceting: + {{{ + q=mainquery&fq=status:public&fq=doctype:pdf&facet=on&facet.field=doctype + }}} + + + Because everything is already constrained by the filter {{{doctype:pdf}}}, the {{{facet.fied=doctype}}} facet command is currently redundant and will return 0 counts for everything except {{{doctype:pdf}}}. + + To implement a multi-select facet for doctype, a GUI may want to still display the other doctype values and their associated counts, as if the {{{doctype:pdf}}} constraint had not yet been applied. Example: + + {{{ + === Document Type === + [ ] Word (42) + [x] PDF (96) + [ ] Excel(11) + [ ] HTML (63) + }}} + + To return counts for doctype values that are currently not selected, tag filters that directly constrain doctype, and exclude those filters when faceting on doctype. + + {{{ + q=mainquery&fq=status:public&fq={!tag=dt}doctype:pdf&facet=on&facet.field={!ex=dt}doctype + }}} + + Filter exclusion is supported for all types of facets. + Both the {{{tag}}} and {{{ex}}} local params may specify multiple values by separating them with commas. = Deprecated Parameters =
