Currently the soft limit for facets is 0 based. That means that "no limit" maps to 0 and the facet will always need to display a minimal number of facet options in order to hide the remaining facet options. The soft limit should be changed to be -1 based, so that a user could select 0 as the soft limit. A soft limit of 0 would mean that the face would appear, but not show any facet options until the "show more" link was clicked. This is particularly useful on sites that have a very large number of facets.

For example, the current 0 based facet with soft limit 0 shows:

Facet Name

  • One (999)
  • Two (888)
  • ...
  • Ten (777)

Where with a -1 based soft limit, the above would represent the -1 setting, with the following representing the 0 setting:

Facet Name
Show Options

Hopefully that makes sense.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cpliakas’s picture

Hi jyee.

Interesting use case, and thanks for sharing. This seems inline with how some of the other settings work, and I would be in favor of this change. The tricky part will be the update scripts that will change the saved settings from 0 to -1, but it should be doable. Would love to see a patch for this if anyone wants to try and tackle it.

Thanks for posting,
Chris

robinvdvleuten’s picture

Hi jyee,

Do you have a patch for this functionality? Otherwise I would give it a try.

Cheers,

Robin

robinvdvleuten’s picture

Status: Active » Needs review
FileSize
2.36 KB

I've created a quick patch that changes the 'no limit' value from 0 to -1.

cpliakas’s picture

Issue summary: View changes
Status: Needs review » Needs work
FileSize
19.6 KB

Thanks for the contribution!

Marking as needs work because the update script didn't work on my installation and the setting doesn't work as expected. More specifically, a single item is displayed. See the screenshot below for a facet configured with a soft limit of "0".

heshanlk’s picture

Status: Needs work » Needs review
FileSize
3.26 KB

Modified @robinvdvleuten's patch to allow what mentioned by @cpliakas, so here it is.

rimen’s picture

Updated patch to current dev

Status: Needs review » Needs work

The last submitted patch, 6: change-soft_limit-value-1821250-6.patch, failed testing. View results