It seems that the "Bundles" setting for datasources introduced in #1184610: Limit indexes to specific entity bundles still has a major flaw: if the index is set to "Index items immediately", updated nodes will still be indexed even if they are of a bundle that shouldn't be indexed.
Basically it's exactly the same problem as discussed in #1184610-52: Limit indexes to specific entity bundles and the following comments – just for item updates instead of inserts. I don't really know why no-one thought about this (foremost me, of course) and why no-one has realized this yet, but I'm pretty sure it happens.

One clear indication, if you're using Solr, is a "Server index status" item count that is consistently higher than the total number of items shown for "index status". (Since the wrongly-indexed items will only be indexed, not tracked as being in the index.)

Comments

drunken monkey’s picture

Status: Active » Needs review

Here's the patch, analogous to the one in #1184610-58: Limit indexes to specific entity bundles. I also do the same for deletes, to avoid deleting non-existent items from the server. This, however, is probably just a small performance gain, and should not have led to any bugs before.

Anyways, it would be great if a few people could test this, so that we can be reasonably sure that this finally fixes the feature. (Bad luck I spotted this a few days after the new release.)

drunken monkey’s picture

StatusFileSize
new4.78 KB
ufku’s picture

Status: Needs review » Reviewed & tested by the community

Nodes are being indexed silently without affecting the index stat in index summary page. I guess that's why nobody has realized it.

The patch works as expected. Thanks.

strykaizer’s picture

#2 works as expected, thanks!!

  • drunken monkey committed 834d1d1 on 7.x-1.x
    Issue #2520684 by drunken monkey: Fixed "bundles" setting on indexes...
drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for testing, good to hear it works for you, too!
Committed.
So here's to hoping that darn feature finally works …

andileco’s picture

EDIT: it is working, but the discrepancy in the numbers is a little confusing.

-----

I noticed this issue: at the top it says "index status 915/915", but down by "server index status" it has a total of 819.

I've applied the patch, but I'm not noticing anything different. I re-queued everything for indexing and indexed now and still it's indexing 915 instead of the correct 819.

Can you list the steps that should be taken after applying the patch? Thanks for the help!

drunken monkey’s picture

The discrepancy may come from other data alterations that reduce the set of indexed items, e.g., "Exclude unpublished nodes". If you are sure this is a bug, please open a new issue and provide more details (e.g., are only correct items indexed, what's your detailed index configuration, etc.).

kerasai’s picture

Was noticing errant data showing up in an index, from a content type thought did not belong. This patch fixed that issue.

We've also got a fairly custom implementation of faceted search and custom rendering, all with test coverage. All tests pass and all search operations seem to work fine.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.