There was a filtering by entity type for entity-based search index before, however I've found out there is no more filtering by entity type available via Search API UI in version 7.x-1.11. Was it depricated? My all indexes were based on entity type and now there is no filtering in search results.

Comments

almc’s picture

Version: 7.x-1.11 » 7.x-1.13

Upgrade to 1.13 doesn't seem to have helped.

By entity types I mean 'bundles'.

almc’s picture

By further experimenting I suspect this may be related to entity caching as well (I also use Entity Cache module). The filtering by entity bundle in the Search API index intermittently disappears and comes back in the index settings. Accordingly it's affecting searching results: they are intermittently get filtered by entity bundle or ignore such filtering. This a serious issue as it makes exposed the data that was not intended for particular view in search results.

Similar issue is observed with views based on search API index: such views from time to time break the filter by entity bundle (if it's included in view), with error message:
No valid values found on filter: bundle name.

Flushing all cache doesn't help in either case.

almc’s picture

I've just been able to get bundle filters back on Search API indexes and related views by clearing all APC cache. All indexes need to be rebuild after that. I still don't understand when and why bundle filters get lost. Has anyone had similar issue?

almc’s picture

Title: No filtering by entity type in newer version? » Breaking entity bundle filters in Search API- based indexes and views

Opened corresponding issue for APC module: https://www.drupal.org/node/2316917 and updated the issue title.

drunken monkey’s picture

Priority: Major » Normal

I have no idea why this problem should occur. So what you're experiencing is that, sometimes, when going to the index's "Filters" tab there is no "Bundle filter" displayed there?
That would be really weird, since whether that is displayed depend's on the entity type's information, which should in theory stay completely constant and not be influenced by entity caching or anything else.

Or do you mean the filter just doesn't work correctly for some individual entities?

almc’s picture

Yes, I observe the former from your comment: "sometimes, when going to the index's "Filters" tab there is no "Bundle filter" displayed there", worse part of it that the bundle filter when not being seen on the index's "Filters" tab also stops working in the views built upon that index, showing records that should have not been shown.

drunken monkey’s picture

Could you please post screenshots of your index "Filters" and search view configuration?

joshua.boltz’s picture

StatusFileSize
new373.7 KB
new103.64 KB
new181.23 KB

I'm not sure if it's necessarily broken or just not a reliable feature, but I'm using Solr + Search API.
I use apachesolr_term module which allows me to index taxonomies in Solr. I'm using the search_api_solr module so Solr and Search API can talk.
But, while the taxonomies get indexed properly in Solr, only node types are available in the Search API bundle filters (where I would expect terms to also be available).
In digging around with dpm() statements (see index_data_from_dpm.png), it appears the Search API index I'm wanting terms on has a base table of node, which makes sense why terms don't show.
But, how can i get a single Search API index to use both node and taxonomy base tables?
Possibly https://www.drupal.org/node/2006396? But how to get that into the index structure?
Screenshots attached to help visualize my scenario.

drunken monkey’s picture

apachesolr_term only works together with the apachesolr module, it won't do anything for Search API Solr (and using both modules at the same time can lead to problems with your Solr index).
I also have no idea what you want to do with taxonomy terms and bundle filters, and I also don't think this issue is related to yours – so, if you need help figuring this out, please create a new issue with a proper description of your problem and the use case you want to solve.
If you want to index both taxonomy terms and nodes in the same Search API index (which is something different than the Solr index), then you could use the new "Multiple types" item type when creating an index.

legolasbo’s picture

Status: Active » Closed (outdated)

This issue has not seen activity in over 2,5 years. I am therefore closing this issue to clean up the issue queue. Feel free to re-open and update this issue if you feel this issue is still relevant and of importance.