Closed (fixed)
Project:
Facets
Version:
3.0.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
5 Dec 2024 at 21:06 UTC
Updated:
29 Oct 2025 at 13:59 UTC
Jump to comment: Most recent
As a developer I would like to see the "Hard limit" setting for facets ported over to the facets exposed filters.
Enable facets_exposed_filters
Create a Search API index based view
Create a Facet
View the settings for the facet
Fail to find the setting for "Hard limit"
Add field to the form and incorporate
X Create issue fork
X Review and test
_ Merge
New field on facets exposed filter widget for "Hard limit"
Hard limit will be passed to search api as value for field "limit" previous value was 0
None
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
scott_earnest commentedComment #3
scott_earnest commentedSomething to note - in our case we are using search_api_opensearch - which will not set the limit (size) parameter if it is "0". We were seeing the default value for this api which was 10 records. Perhaps using other search api's "0" means "unlimited"?
Comment #5
scott_earnest commentedTesting Instructions
Create a Search API Index based view
Create a facet exposed filter
Find the new (old) field for "Hard limit"
Verify this will affect the total number of options in the facet dropdown (you should be able to see this in the preview)
Comment #6
scott_earnest commentedComment #7
griz commentedI'm also using OpenSearch and have experienced the same behaviour. This patch works for me.
Comment #8
sagesolutions commentedI'm using OpenSearch as the indexing backend, on Drupal 10 and Facets 3.0.0. The default is 10 items when no limit is set. Adding this patch allowed me to set the limit so I could show more.
Marking as RTBC
Comment #9
scott_earnest commentedComment #10
johnny5th commentedPatch works for me
Comment #11
strykaizerThanks,
I do wonder, why hardcode the options? Wouldnt it make more sense to just use a numberfield, which allows the user to pick whatever they prefer?
Comment #12
chrisolofConfirming MR 262 is working great in my tests.
+1 on the number field idea. It appears these hard-coded options are just carried over from the 2.x config form. Probably it makes for a nice clear "No limit" option chosen by default instead of an empty box. Maybe we'd need to modify this text:
To something like:
It appears this new setting still needs to be added into the module's config schema (config/schema/facets.views.schema.yml).
Does this need test coverage?
Comment #14
aleixSo, I changed the select to number field and use this text as description:
Also added hardlimit in config schema yml and I also did some minor labels changes.
Comment #15
oulalahakabu commentedDrupal 11, elastic 8, facets 3.0.1 patched, work as designed.
Comment #16
borisson_This change looks good, RTBC++
Comment #17
strykaizerComment #19
strykaizer