lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Harwood <markharw...@yahoo.co.uk>
Subject Re: ComplexPhraseQueryParser and stop words
Date Fri, 02 Nov 2012 07:51:43 GMT
Hi Brandon,
Can you start by calling toString on the parse result (the Query object)  to see what is being
produced and post that here. 
On the face of it it sounds like it should work OK.  What happens if you use the "normal"
query parser on your query "time to leave" - that should parse ok as the query contains no
markup that makes it a complex phrase.

Cheers
Mark

On 1 Nov 2012, at 19:54, Brandon Mintern <mintern@easyesi.com> wrote:

> We are still having the issue where ComplexPhraseQueryParser fails on
> quoted expressions that include stop words. Does the original
> developer of this class still contribute to Lucene?
> 
> On Fri, Oct 26, 2012 at 3:37 PM, Brandon Mintern <mintern@easyesi.com> wrote:
>> We recently switched from QueryParser to ComplexPhraseQueryParser
>> (from lucene-queryparser-3.6.0.jar), and we've come across two
>> separate problems.
>> 
>> The first is that because it parses quoted expressions twice, it is
>> necessary to double-escape any escaped characters. So if I do not want
>> to allow users to include : in their search, I have to escape it as
>> \:, but when it is in quotes, I have to escape it as \\:, because the
>> first parse will turn \\ into \ and then the second time around will
>> do the proper escape. Likewise, I need to escape \ because it shows up
>> frequently in paths. When not in quotes, this is simply \\. In quotes,
>> it must be \\\\.
>> 
>> So that was a minor issue, but we were able to work around it without
>> too much trouble. This next problem, though, does not seem to have an
>> easy answer.
>> 
>> Our searches for quoted phrases which include stop words no longer
>> match. If a document contained the phrase "time to leave", only "time"
>> and "leave" get indexed, but their positions are maintained so that a
>> later search for "time to leave" works correctly. With the standard
>> QueryParser, this worked just fine. With the ComplexPhraseQueryParser,
>> it no longer works at all. Searching for time AND leave works, but
>> "time to leave" simply fails.
>> 
>> Does anyone know where I should start in solving this issue?
>> 
>> Thanks,
>> Brandon
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
> 

---------------------------------------------------------------------
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