suffix searching and wildcard searches
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

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

Re: suffix searching and wildcard searches

Posted By:   Anonymous  
Posted On:   Wednesday, April 24, 2002 09:57 AM


OK looking more closely at the hits returned in the TermEnum I see the expected caveat.


The Indexing relies on prefixes to index and retrieve documents. makes sense. I found this post useful as well:


http://marc.theaimsgroup.com/?l=lucene-user&m=101797475710371&w=2

About | Sitemap | Contact