No results are returned after I add qp.setAutoGeneratePhraseQueries(true).

After I remove qp.setAutoGeneratePhraseQueries(true), I can get results back.


Anything should be taken care of before/after adding the line of code?





------------------ Original ------------------
From:  "Jack Krupansky"<[email protected]>;
Date:  Tue, Aug 14, 2012 08:37 PM
To:  "java-user"<[email protected]>; 

Subject:  Re: Does the string "Cla$$War" affect Lucene?



Add qp.setAutoGeneratePhraseQueries = true before calling qp.parse.

Otherwise, the query (clause of the larger BooleanQuery) will be the same as 
"cla" OR "war", which will match all "war" documents, plus any "cla" 
documents you may have.

-- Jack Krupansky

-----Original Message----- 
From: zhoucheng2008
Sent: Tuesday, August 14, 2012 8:29 AM
To: java-user
Subject: Re: Does the string "Cla$$War" affect Lucene?

BooleanQuery bq;
QueryParser qp;
qp = new QueryParser(version, "title", analyzer);
bq.add(qp.parse(QueryParser.escape("Cla$$War")), Occur.valueOf("MUST"));



version = Version.LUCENE_35;
analyzer = new LimitTokenCountAnalyzer(new StandardAnalyzer(
Version.LUCENE_35, CharArraySet.EMPTY_SET),
ERConstants.maxTokenNum);



Is it because of the QueryParser.escape()?




------------------ Original ------------------
From:  "Ian Lea"<[email protected]>;
Date:  Tue, Aug 14, 2012 04:39 PM
To:  "java-user"<[email protected]>;

Subject:  Re: Does the string "Cla$$War" affect Lucene?



Sounds extremely unlikely.  What is the query?  What analyzer? What
version of lucene?  What about other strings containing $$?


--
Ian.


On Tue, Aug 14, 2012 at 9:13 AM, zhoucheng2008 <[email protected]> 
wrote:
> Hi,
>
>
> I have a big index, and when I searched it with a title string "Cla$$War", 
> Lucene became very slow. It doesn't happen when I searched with other 
> title string such as "Gone with Wind". Does the "$$" affect the search 
> performance?
>
>
> Thanks,
> Cheng

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected] 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to