Posted By:
Anonymous
Posted On:
Tuesday, April 23, 2002 01:08 PM
the Lucene code seems to have a problem with wildcard searches of the form: *suffixTerm. I notice that the QueryParser, when given a search string of the form: prefixTerm*, uses the class org.apache.lucene.search.PrefixQuery to return matching terms. The class basically just gets a TermEnum of matching terms from an IndexReader, and filters out all terms for which term.startsWith(prefixTerm) is false. So the question is this: is there a reason that a SuffixQuery isn't provided? Is it only necessary to implement a SuffixQuery class, and modify the QueryParser to recognize such query strings? Or is there a caveat there? I ask because of the omission of this expected functionality. The QueryParser thro
More>>
the Lucene code seems to have a problem with wildcard searches of the form: *suffixTerm.
I notice that the QueryParser, when given a search string of the form: prefixTerm*, uses the class org.apache.lucene.search.PrefixQuery to return matching terms. The class basically just gets a TermEnum of matching terms from an IndexReader, and filters out all terms for which term.startsWith(prefixTerm) is false.
So the question is this: is there a reason that a SuffixQuery isn't provided? Is it only necessary to implement a SuffixQuery class, and modify the QueryParser to recognize such query strings? Or is there a caveat there?
I ask because of the omission of this expected functionality. The QueryParser throws an Exception when given Strings like: *term. Strange.
<<Less