lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Lennon" <niall_len...@hotmail.com>
Subject Re: MultiFieldQueryParser & Phrases Problem
Date Mon, 22 Sep 2003 00:20:32 GMT
Cheers for that Erik.


>From: Erik Hatcher <erik@ehatchersolutions.com>
>Reply-To: "Lucene Users List" <lucene-user@jakarta.apache.org>
>To: "Lucene Users List" <lucene-user@jakarta.apache.org>
>Subject: Re: MultiFieldQueryParser & Phrases Problem
>Date: Sun, 21 Sep 2003 18:46:38 -0400
>
>StandardAnalyzer removes stop words and "a" is one of them.  That is why 
>you have issues with that phrase.
>
>	Erik
>
>
>On Sunday, September 21, 2003, at 06:13  PM, Niall Lennon wrote:
>
>>I'm currently using the MultiFieldQueryParser to search across four 
>>fields. I'm searching for phrases so i've wrapped my search text in 
>>quotes... everything worked
>>fine until i tried to execute a search ending with the 'A' and for some 
>>reason the A and quotes are ignored e.g.:
>>
>>
>>Analyzer analyzer = new StandardAnalyzer();
>>Searcher searcher = new IndexSearcher(IndexReader.open("dbindex"));
>>
>>String[] fields = {"code_field", "short_description_field", 
>>"category_field", "manufacturer_field"};
>>int[] flags = {MultiFieldQueryParser.NORMAL_FIELD, 
>>MultiFieldQueryParser.NORMAL_FIELD, MultiFieldQueryParser.NORMAL_FIELD, 
>>MultiFieldQueryParser.NORMAL_FIELD};
>>
>>Query query =    MultiFieldQueryParser.parse("\"Category A\"", fields, 
>>flags, analyzer);
>>
>>System.out.println("query -> " + query);
>>
>>Hits hits = searcher.search(query);
>>
>>
>>
>>The System output for the above is as follows:
>>code_field:category short_description_field:category 
>>category_field:category manufacturer_field:category
>>
>>
>>
>>If i execute the same code with the following search text i get the 
>>expected results:
>>Query query =    MultiFieldQueryParser.parse("\"Category Z\"", fields, 
>>flags, analyzer);
>>
>>
>>code_field:"category z" short_description_field:"category z" 
>>category_field:"category z" manufacturer_field:"category z"
>>
>>
>>
>>I' appreicate any help with regards this matter...
>>
>>_________________________________________________________________
>>The new MSN 8: advanced junk mail protection and 2 months FREE* 
>>http://join.msn.com/?page=features/junkmail
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>

_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail


Mime
View raw message