wikmd icon indicating copy to clipboard operation
wikmd copied to clipboard

Search not working?

Open apiening opened this issue 2 years ago • 2 comments

I have deployed a test instance with docker-compose based on this example: https://linbreux.github.io/wikmd/installation/docker.html#docker-compose-recommended-click-here-for-more-info

I have copied a few .md files in the wiki folder and they're displayed correctly. However, the search always reports Found 0 result(s) for '<keyword>' when I search for words that are included in my markdown files.

Is there anything required to enable searching? How is it even implemented? Is it index based and I need to trigger a reindex?

Btw.: I just found this project via google and it looks very nice!

apiening avatar May 26 '23 10:05 apiening

@apiening that's weird... Normally the indexing is triggered automatically. You can try to edit in the browser and save your file again there. I'll check it this week. Does an other docker tag work?

Linbreux avatar May 27 '23 14:05 Linbreux

I did a regular install and ran into the same issue. I am using WSL2 / Ubuntu. The issue is that Watchdog relies on inotify and if you are using WSL2 or Docker on Windows it won't work unless you put your files on the Linux filesystem.

A quick but slightly suboptimal fix is to go into search.py and change Observer() to

    def watchdog(self):
        #observer = Observer()
        from watchdog.observers.polling import PollingObserver
        observer = PollingObserver() 

Maybe we could specify whether to use a PollingObserver option via the wiki config?

chrsbats avatar Nov 08 '23 05:11 chrsbats