How to implement auto complete or word suggetions feature in couchbase lite and flutter?

Hi Guys,

In my flutter project, there is a requirement for a full-text search feature for offline data. That is why I choose to use couchbase lite. I want to give word suggestions to a user when he/she types in the search bar but I found nothing on the internet about how to implement it. Please help me if anyone knows how to implement this feature. Currently, I am able to implement the full-text search feature but not getting word suggestions.

I don’t think auto-complete or suggestions are supported by Couchbase Lite’s FTS.

Couchbase Lite has a Pattern Matching Syntax that you can use to control how a FTS query is matched against a FTX index.

I found that a good starting point for a search feature is to take the search query that is specified by the user, split it into words, put the AND operator between each word and append * (prefix expression) to the last word. If you run the query on each keystroke, and show the user the results, they won’t have to enter a complete word before they see possibly useful results.