Concept Overview
So to get the search working you first need to build an archive of indexes from your markdown files. These indexes would be used during search.
The building of indexes must be done every time you deploy your site.
To make this comfortable you can use git hooks, github actions or a dockerfile. A quick search provides more information on the three methods to make it more comfortable.