Compatibility with search_api and facets

Created on 16 April 2024, 9 months ago
Updated 24 April 2024, 9 months ago

Problem/Motivation

I've build an access policy controlling user access to node with the "matching taxonomy terms" setup.
All is good, content access is controlled as excepted: users can only access to nodes with the matching terms.

I've then added a search_api view to display the nodes: the index processor "Node access" is checked.
Still good, only nodes for which the user has access to are listed (tested with a bunch of users with different accesses).

Then, I've added some facets to filter the search_api view, facets display results counters.
With a user that can bypass the access policy (or onewith access to all), the facets counters are good.
With a user controlled by the access policy, the facets counters still count all nodes, whether the user has access to them or not.
Beside the false counters, the user could click on a facet tha lead to no result.

I'm aware it involves 3 modules (access_policy, search_api and facets) but I have to start somewhere ;-)

I'm not sure there is a need for a field to be added to the search index to filter the results view has it's already OK as is.
The problem only seems related to the facets counters.

πŸ’¬ Support request
Status

Postponed

Version

1.0

Component

Code

Created by

πŸ‡«πŸ‡·France PhilY πŸ‡ͺπŸ‡ΊπŸ‡«πŸ‡· Paris, France

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

Comments & Activities

  • Issue created by @PhilY
  • πŸ‡«πŸ‡·France PhilY πŸ‡ͺπŸ‡ΊπŸ‡«πŸ‡· Paris, France

    I gave a try to the tac_lite module which also determines node access with the "matching taxonomy terms" setup: facets counters are then good and related to how many nodes the user has access to.

    So, maybe to the way access_policy declares access to node is different from how Drupal 10 handles it (which seems to be used by facets)...

  • πŸ‡ΊπŸ‡ΈUnited States partdigital

    Hi PhilY,

    We're not supporting Search API at this time while we focus on getting 1.0 out. Definitely open to any contributions though!

  • Status changed to Postponed 9 months ago
  • πŸ‡ΊπŸ‡ΈUnited States partdigital
Production build 0.71.5 2024