Search API integration

Created on 18 March 2022, over 2 years ago
Updated 25 August 2023, about 1 year ago

Problem/Motivation

Search API provides its own custom views data, fields, filters etc. which this module does not pick up on. It is therefore not possible to use the filter provided by this module in search API views. It should be.

Steps to reproduce

  1. Create or select a test site.
  2. Ensure you have this module, the search API module and a suitable backend (e.g. search_api_solr or the built in search_api_db module for testing)
  3. Ensure you have a vocabulary populated with terms in a tree.
  4. Ensure you have a node with a field which references this vocabulary.
  5. Ensure you have a search API server and index configured. The index should index the node from the steps above and the vocabulary field specifically.
  6. Create a search view of this index
  7. Open the add filter button. You will see that there is no entityreference_filter option available, though there should be a generic entity reference for the category

Proposed resolution

This seems to be pretty simple to resolve, at least for terms. We just need to add a very simple search API views plugin that extends the existing one and adjust the views data accordingly.

Remaining tasks

The patch I'm submitting only really works for terms. Search API doesn't seem to have an explicit entity reference filter for other entity nodes that I can see, at least not in the same way as it does for terms. This could probably be expanded to work for other entity references as well.

Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

🇨🇦Canada dylan donkersgoed London, Ontario

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024