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
- Create or select a test site.
- 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)
- Ensure you have a vocabulary populated with terms in a tree.
- Ensure you have a node with a field which references this vocabulary.
- 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.
- Create a search view of this index
- 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.
Issue fork entityreference_filter-3270362
Show commands
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 #3
dylan donkersgoed commentedComment #5
maximkashubaThe issue will be checked in 2.0.x branch.
Comment #8
maximkashubaThanks for the patch Dylan Donkersgoed.
Updated the patch and tests.
Comment #9
maximkashuba