kaykay-dv / pocketsearch

A simple full-text search library for Python using SQLite and its FTS5 extension
https://pocketsearch.readthedocs.io/en/latest/
MIT License
1 stars 0 forks source link

Convenience function for autocomplete #30

Closed kaykay-dv closed 1 year ago

kaykay-dv commented 1 year ago

A convenience function for autocomplete use cases should be designed that returns a list of query suggestions based on the characters provided. Suggested implementation:

API:

# return suggestions where title contains tokens that have the prefix "ind"
pocketsearch.autocomplete(title="Ind")
# return suggestions where title contains tokens "indiana" AND tokens with prefix "jo"
pocketsearch.autocomplete(title="Indiana jo")
# typeahead should return a Query objects, so we use all other methods on it:
pocketsearch.autocomplete(title="Indiana jo").order_by("-rank")
kaykay-dv commented 1 year ago

Implemented in 0.10.0