Earlier I had this issue #1248646: After deleting custom entites, then re-indexing fails, which was my error.

But the deleted entities still exist in the Apache Solr system. This causes "ghost" facets/results to show up on search. See screenshot to understand.

I have to do a 'Clear index' to definitively remove them from Solr.

CommentFileSizeAuthor
#6 1250168--remove-deleted-items-from-servers.patch1.28 KBdrunken monkey
solr-not-flushed.png30.05 KBAnonymous (not verified)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drunken monkey’s picture

Are you sure they aren't deleted at all? Currently, they are deleted, but the action is not committed, meaning the autocommit after 120 seconds should take care of it.
This is of course also quite a problem, but should be fixed with #1225926-5: Fix performance problems in indexing workflow.

Anonymous’s picture

No, my items aren't deleted (after waiting 15 minutes at least). The content is still in Solr's "*.fdt" files etc. etc.

>> meaning the autocommit after 120 seconds should take care of it.
Where can I check this autocommit setting, is it a Solr default? I don't find the value "120" in the module code, so maybe my Solr default is different.

Anonymous’s picture

Title: Deleted items aren't removed from servers » Deleted custom entities remain in Solr index
Project: Search API » Search API Solr
Component: Framework » Code
Priority: Major » Normal

I think the service.inc's deleteItems() is not called?

Where can I check this autocommit setting, is it a Solr default? I don't find the value "120" in the module code, so maybe my Solr default is different.

drunken monkey’s picture

Title: Deleted custom entities remain in Solr index » Deleted items aren't removed from servers
Project: Search API Solr » Search API
Component: Code » Framework
Priority: Normal » Major

Where can I check this autocommit setting, is it a Solr default? I don't find the value "120" in the module code, so maybe my Solr default is different.

It's "120000", specified in milliseconds. It should be on line 239 of solrconfig.xml, under config > updateHandler > autoCommit > maxTime.

I think the service.inc's deleteItems() is not called?

Oh god, you're right, I simply removed that in #1064884: Add support for indexing non-entities! Patch coming soon …

Anonymous’s picture

Title: Deleted custom entities remain in Solr index » Deleted items aren't removed from servers
Project: Search API Solr » Search API
Component: Code » Framework
Priority: Normal » Major

Thanks, yeah that should be it.

drunken monkey’s picture

Status: Active » Needs review
FileSize
1.28 KB
Anonymous’s picture

It works for me, I applied that last bit from the patch.

This wasn't in the dev-x yet,

if ($indexes) {
     search_api_get_datasource_controller($type)->trackItemDelete($item_ids, $indexes);
   }

The fix itself works fine though.

drunken monkey’s picture

Status: Needs review » Fixed

It should be in the dev since #1236642-10: Static cache of search_api_get_item_type_info() is never cleared, so for almost an hour at the time of your post! ;)

Anyways, thanks for reviewing! Committed.

tnightingale’s picture

Hilarious, was just about to submit an issue when I saw that this fix was committed an hour ago!
Thanks guys!

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Wording