I'm currently working on a small scale personal project using peewee and sqlite3 to store data locally within the app in a database as a fun way to increase my coding knowledge & skills.
It's mostly static data and the main usage would be to reflect information linked to certain keys. As an example:
- Tennis: Tennisball, gravel, 2 players
- Football: football, grass, 22 players
- American football: american football, grass, 22 players
- Basketball: basketball, wood, 10 players
- Volleyball: ...
- ....
- ......
One thing I'd like to implement is a real time search which searches for either 1) only the key words before the ':' (tennis, football, basketball, american football,..) and/or 2) searches all data for that exact string.
But I want to have the search function provide you with the remaining key words in real time. Meaning every time I type a letter, I want it to show you the remaining key words it matches with. And it is exactly this feature I can't seem to find a solution to.
Example:
Typing 'b' will show you all key words with a 'b' in it. While with each new letter you type, it should further truncate the results further. 'Ball' will generate keys numbered 2, 3, 4 & 5 in the example on the top. While typing 'football' generates only keys numbered 2 & 3.
I hope this is somewhat making sense. I need some guidance or sense of direction where to look for something I'd like to implement as I have been unable to find any similar question.
Edit:
I saw this was flagged several times as duplicate question however I did search on this site and the internet for solutions to this but found none. It is not the autocompletion à la Google I'm going for. If it is a duplicate, I would be very happy if there would be a link to the answer to my question.