Permissions-based limit on the number of facets a user can select

Created on 22 October 2024, 5 months ago

Problem/Motivation

Faceted search is amazing and powerful but it can totally bust the concept of caching your website.

How difficult would it be to set limits on the number of facets of each type that can be selected, with a permission to ignore these limits? This way an anonymous visitor could select three tags, two content types, and one author (for example) limiting the combinations to be cached to something like (2×200)×(1×10)×(1×50)=200,000, AKA 2×10⁵, rather than bots spidering through all the combinations that are available, something like (200!)×(10!)×(50!) = 8.704153×10⁴⁴⁵ (i know the math is inexact but i think the orders of magnitude are about correct when selecting more of a given facet expands the results. As far as caching, this makes the needs when all options for every facet are selectable effectively infinite. And then multiply by the pages of results for infinity times 20…).

Proposed resolution

This could be a per-facet option that sitebuilders could enable for "expensive" facets, enforced both with JavaScript for a good user experience and on form submission for strong protection.

Paired with a permission like "Ignore facet option selection limits"

Remaining tasks

Perfectly happy to put this in a contrib module but i think i need help with feasibility and architecture. Thanks!

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

3.0

Component

Code

Created by

🇺🇸United States mlncn Minneapolis, MN, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024