Hatta keeps several index files for fast searching and backlink display. They are updated every time you edit a text page. But when you edit the files with your own editor, not using the wiki, the index files are not updated. This may result in some new words and links not appearing in the searches.
Workaround
Delete the cache directory after editing text files from outside of the wiki, restart the wiki – the cache will be regenerated.
Alternatively, just edit the page again in the wiki, it's contents will be reindexed.
Workaround not working
I can't get it to recreate indexes. I'd like to be able to deposit files in there, commit them to the mercurial repository, restart Hatta, and have a single history revision there in addition to backlinks, etc… any way I can make that happen? I see that the manual reindex option may not be end user friendly, but the person who is modifying the repo should be comfortable with it (like me). Especially if we're here because of the fact this wiki uses mercurial in the first place.
You must commit (hg commit) after introducing the changes. – Radomir Dopieralski
Possible solutions
Regenerate index on any external change
The wiki can keep track of the last change ID that was done from the wiki, and compare it with the last change ID of the repository. If they are different, search for all pages that were edited between them and regenerate the indices for these pages. The check itself is relatively cheap, but checking all changes can be costly, especially when the wiki is not the only thing in the repository. This may be too expensive to do on every request – maybe only do it on wiki restart or on search?
Provide option to manually regenerate index
This is an ugly solution, usability-wise, and doesn't work if the user doesn't know that something was edited externally.
Use a commit hook
Mercurial allows setting hooks to be called when a commit is performed. But this requires complicated configuration to be done by the user.
Meta
Hatta version: 1.0.0
![[Home]](/+download/logo.png)