lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: Wild card and multiple keyword search
Date Wed, 13 Jul 2005 23:52:48 GMT

On Jul 13, 2005, at 10:40 AM, Rahul D Thakare wrote:
>  que: - The question back to you is do you want searches for simply  
> "MAIN" to
> find both "MAIN LOGIC" and "MAIN PARTS"?  Or should it return no
> documents since its not an exact match?
>
> Ans: It should return no documents since it is not a exact match.
>
> I would like to explain my point 2 in below mail again by giveing  
> an example here
>
>  eg- If there are two records with keyword ie "Main Logic" and  
> "Main Board" respectively.
>
> what we want is
> 1. if the user serch on Main*, both the record should return.
> 2. If the user search on "Main Logic", only one record should be  
> return.
> 3. If the user searches for Main, no record should be returned
>
>
>  point 2 above is working now because we are using Field.Keyword  
> (which doesn't tokenise the spaces) and KeywordAnalyser.
>
>  point 1 (wild card search) is not working because KeywordAnalyser  
> does not recognise wild card

That's not quite accurate about why wild card search isn't working.  
My hunch is that it is the lowercasing effect of QueryParser.  There  
is an _instance_ setter to control it.  You'll need to construct an  
instance of QueryParser, call setLowercaseWildcardTerms(false), and  
then call the parse(String) method.

     Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message