I'm currently working on a Nextra project where i store my documentation, from my understanding, Nextra uses Flexsearch (by default, i'm not using any custom search system) to perform searches.
My plan is to have a rest api such as mywiki/api/search?query=something that would return the URLs for the top 5 results. While i've successfully setup the api endpoint, i'm at a loss as to how to import the Flexsearch into my api. Once that is imported i belive it's as easy as calling index.search(query) but i cannot find any documentation anywhere on how to achieve that.