Problem/Motivation
I'm not to sure if I'm understanding the usage of this module so please forgive me if I'm wrong in my understanding of how this should work. I have two content types: Property and Estate Agent. Properties reference Estate Agents using an entity reference field. I have an index of "Properties" which indexes all the property fields and also some of the fields of the referenced agents too. I have a view of properties which currently has the name of the referenced agent as the only field. This is to be a view with facets for property fields such as the type of property / price range of the property etc... and I'd like the list of estate agents to not have any duplicates.
Normally I'd use views aggregation to aggregate / group based on the estate agent ID / title but aggregation is not available for search index views. So I installed this module and grouped the index based on the "Estate Agent" entity reference field.
The view now has no results and looking in the logs I can see:
Warning: count(): Parameter must be an array or an object that implements Countable in Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend->extractResults() (line 2710 of /var/www/vhosts/example.local/httpdocs/modules/contrib/search_api_solr/src/Plugin/search_api/backend/SearchApiSolrBackend.php)
Am I not using this module correctly or is this a bug?
Comments
Comment #2
vaccinemedia commentedI actually managed to get this working by enabling the "Reverse entity references" processor on the index and work backwards from the Estate Agents. I now have a view which outputs a map of agents plus a table of results based on property node value facets such as price and type.
This can be closed but only if this is not a bug with this module which may still be the case despite the fact I figured out a work around.