If you have only 1000 sentences, you probably do not need a powerful index like lucene. I’m not sure if you want to make the sentences “complete the sentence” or “offer other requests containing the same keywords”. Here are solutions for both:
, , SortedSet tailSet, , "", ( A, B "", B). , tailSet, , inputString.length() . , inputString.length() .
" ", , . , HashMap<String,Set<String>>, , . , .
, , (, ). , . - , ? , .