I am using Springs+Hibernate in my application. I have a auto suggest which can search on field where the starting letters match
If values in database are
1 Green curry 2 curry chilly 3 Red Green Chilly Curry
If I type
curr it should give me all the above values as suggestion If I type Gree it should give me 1 and 3. If I type urry (missing c) it should not give any results
In short I want to search starts with on any word. The data is stored in single field in database and can have huge number of records (30 to 40k for autosuggest).
What design should we go with to satisfy the requirement considering we do not want to change the data base scheme to split the storage based on space.
1. Keeping some in memory data structure? 2. Using index search like lucene? Might be too much work to introuce indexing for this simple requirement? 3. Any other way to perform such queries in hibernate? 4. Any other ideas?