There is a corresponding issue posted against Facet API at #1219150: Add support for minumum facet counts. If would be great if Apache Solr would integrate with the new feature.

Comments

cpliakas’s picture

Status: Active » Needs review
StatusFileSize
new2.6 KB

The attached patch integrates with the new feature.

pwolanin’s picture

I thought I was already adding a mincount of 1 elsewhere?

cpliakas’s picture

You are adding it in the adapter's initActiveFilters() method. This patch allows users to override that value for selected facets through the interface. For example, if they want a mincount of 10 then they would set that in the facet's "global settings" via the Facet API interface.

cpliakas’s picture

StatusFileSize
new139.17 KB

The attached screenshot further illustrates the feature request and what the patch accomplishes.

Ravi.J’s picture

This is a great feature to have. I guess value zero (0) for Minimum facet count would mean there in no limit and display all facets.

pwolanin’s picture

No, zero rather means the facet blcok displays even if there are zero results for that facets (I think).

The mincount is quite different from the facet limit, which was already configurable.

cpliakas’s picture

A value of 0 means that all available facets are displayed even if their count is zero. In many cases this is not useful and is not supported by some backends, so Facet API requires that a positive integer be passed. In addition, it defaults to 1 like the current Apache Solr Search Integration implementation.

If for some reason the backend wanted to allow a value of 0, it would simply have to form alter the settings form and change the validation callback for the element.

cpliakas’s picture

Title: Add support for minumum facet counts » Add support for customizable minumum facet counts

Changing title to more accurately reflect the feature request.

cpliakas’s picture

StatusFileSize
new231.86 KB

Interesting. Found an example where a mincount of "0" is being used with a pretty cool effect. The attached screenshot was taken from http://www.lucidimagination.com/search/.

cpliakas’s picture

Posted a corresponding issue against Facet API #1222834: Allow for a mincount of 0. The patch in #1 is not dependent on the resolution of this issue in any way. This is more of a sidetrack based on my comment in #6.

pwolanin’s picture

Patch looks fine - commit it if you're satisfied it works.

cpliakas’s picture

Status: Needs review » Fixed

Seems to work well for me. Committed at 740b4ca.

cpliakas’s picture

Quick follow-up commit at 6878a6d.

Automatically closed -- issue fixed for 2 weeks with no activity.