Building search suggestions for a website

I want to build a search engine for a small website. Agolia or mellisearch would do the work, but they are over my requirements in terms of price and features.

A simple search suggestions would do the work for me. Like building a API that searches the d1 database for given query and return results, but I think this is expensive as it has to go through whole database everytime. And indexes help but i came to know that indexed don't auto update when more data is added to database.

So it there any other way to build this simple in terms of price and code, other than using third party solutions like algolia or builiding an api that queries whole d1 database everytime for each letter of search word? I also came to know about Full Text Search?
Was this page helpful?