Remove deleted items from search results

How do I refresh the ERPNext search index? When searching in the main search bar, items that have been deleted still appear in the search results with links to missing pages

Maybe share a screen shot or something so people can assist you?

These are just a guess:

Possibly ‘bench rebuild-global-search’ does that?

Also a log lists a background job that does say a cleanup or reindex?

frappe@ubuntu:~/frappe-bench$ find logs -name ‘*.log’ | xargs grep frappe.utils.global_search.sync_global_search

Perhaps someone more familiar or qualified could comment?

Otherwise a read of the code but that is work - I long for a code browser like in the Smalltalk days :slight_smile:

2 Likes

bench rebuild-global-search is indeed what you require.

I had the original issue where deleted items were still in the index. This command was added to tidy up the search in cases such as this. It may do no harm to run a Cron with it monthly perhaps …