A self-hosted TiddlyWiki instance (the nodejs-based version, not the single html file approach) might satisfy many of your requirements, albeit not the search preview. https://tiddlywiki.com/
ETA: https://tiddlywiki.com/static/Customising%2520search%2520res...
Yup, totally doable