Support » Plugin: WP Photo Album Plus » “Clean index” maintenance procedure seems to remove important entries
“Clean index” maintenance procedure seems to remove important entries
I’ve been having some issues with certain search terms no longer giving expected results, after some testing I found out that after running the “Remake Index Photos” procedure it goes back to normal, but then after a while it automatically runs the “Clean Index” procedure and after that the search stops working as expected again.
Sorry, very busy, will look tomorrowThread Starter henkbask
Is it safe to pause the Clean Index cron event with a plugin until I can get it fixed?
Yes you can pause clean index. You can do it also on Advanced settings -> Maintenance -> I -> item 0.
Clean index only looks for every word/album and word/photo entry if the word still appears in the album or photo, otherwise the album / photo id is erased from the index entry. Unused entries (where no album and no photo ids are in) are removed at the end of the cleanup process.
On Basic settings -> Search -> I -> Item 35, you can list the actual index table, and see if there is something wrong.
You should know that there is an important difference between the interactive and the background way of re-indexing.
The interactive way clears the index. When running the album re-index, all album ids are removed from the index table, when running the photo re-index, all photo ids are removed form the index table. A said before, completely empty entried will be removed at the end of the cleanup proc.
When running the background process, the table will not be cleared up front, because this proc may take substantial time and we do not want missing entries for a long time.
If your index is a mess and you want ‘start all over’, run the remake proc interactively (using the Start! button AND KEEP THE BROWSER TAB OPEN until completion, otherwise you will have to restart later and in the mean time your index is incomplete. Run them both, but not at the same time!Thread Starter henkbask
I tried Remake and then Remake Index again, like before it works fine after the Remake Index, but Clean Index starts automatically afterwards (an hour later I think) and when I let it finish the search is broken again. I will pause the event over the weekend until I can look into it more.
I will have a closer look to the clean index proc
I did some research and made the code more stable and reliable.
I also added an extra type of logging specially for index operations.
I am still testing it, but i think i can release it tomorrow.
This should fix your issue, or at least documentate everything that happens.
I will instruct you what to do when i finished testingThread Starter henkbask
Ok sounds good, thank you
It will take a little longer, but the good news is that i found the cause of the issue.
In short: there are locations where ‘update index’ is requested, resulting inimmediately removal of the index entries for the album or photo involved, but the re-addition of the entries may take a long time.
So, i will fix that tomorrow and than need a day for testing
I made substantial improvements on background processes and particulary to the indexing mechanism. Before i release this, i would like you to test it.
So, i ask you to download
and install as described here:
then, go to Advanced settings -> Misc -> II -> Item 8: Log index (as the only one), and go to the logfile via the menu. If nothing happens within 15 second, change the description of a photo or album (and change it back) and watch the logfile again.
If you run a remake index procedure it will only add entries to the index for albums or photos that have their index date set to Need reindex. This happens a.o. at an edit description etc. When you start the remake index proc interactively, all items will be flagged at the start of the proc, when you start it as background process, it only processes the flagged items.
after completion, the cleanup index proc will start and checkes all index entries against albums and photos and only removes items from the index that no longer belong to the album or photo as they did before.
so you should never have an empty index for any item that has been indexed beforeThread Starter henkbask
I did some testing and unfortunately the same thing happens, but I can now see a pattern in the logs, it seems to only happen to photos with more unusual characters, like “å, ä, ö, ü, û”
A photo that I could previously find by searching for “Åke” (which is part of the photo name) no longer works, here’s the line in the log about that photo after the cleanup:
“Idx: on:20.01.2023 10:39:39: cron-job (53347): wppa_cleanup_index Removed 34 from photo index word ake because word no longer in photo”
Thanx for this info, this will help me a lot.
To be continuedPlugin Author Jacob N. Breetvelt
I do not have that problem on my dev site, see screenshot:
Thread Starter henkbask
- Are you sure your database character set us UTF-8 ?
- Would it be a problem when i change Åke to Ake etc in the index?
I think it is UTF-8 yes.
If I search the index for “Åke” (after remaking the index and not running cleanup) it shows “ake” with all the photo id’s with Åke in the name, but using the search function on the site with “Åke” works fine even though the index says “ake”.
And when the index is added the log says “Åke”, but when the cleanup removes it, the log says “ake”.Thread Starter henkbask
It’s now at least mostly solved, I deleted a few unused albums/photos, after doing that the cleanup removed “ake” from the index completely, and re-indexing after that correctly added “Åke” to the index, and it remains after cleanup now. I think the problem remains for some photos with other characters still though.
So it looks like the index entry “ake” was probably created for one of my unused photos which may have been incorrectly named, and then every “Åke” got assigned to “ake” instead. But now that “ake” got removed from the index it started working properly again.
- You must be logged in to reply to this topic.