I'm developing a function to find terms into a document.
In parameter of my function, I give a HashSet
of String
. I browse the HashSet
to analyze each string (with the Lucene Analyzer class) then I seek the analyzed string into the text with the PhraseQuery
class to know if it exists into the document.
In return of my function, there is a HashSet
which contains only terms found into the document.
It works, but slowly because of I browse all the HashSet
. Is there no way to give a collection of words to Lucene, then get a collection with only the words that the document gets?