You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by zhoucheng2008 <zh...@gmail.com> on 2012/08/14 10:13:48 UTC

Does the string "Cla$$War" affect Lucene?

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

RE: Does the string "Cla$$War" affect Lucene?

Posted by Uwe Schindler <uw...@thetaphi.de>.
Hi,

If you are using StandardAnalyzer, then "Cla$$War" is split at the $ signs,
so it searches for two tokens, "cla" and "war". If autogenerate phrase
queries is enabled for QueryParser, it will then create a phrase query "cla
war" out of it, which is slower because positions are involved. If
autogenerate phrases is not enabled, Lucene still have to search for 2
terms, so it might get slower, if "cla" or "war" hit many documents. If it
is enabled or not depends on the matchVersion parameter passed to ctor:
http://lucene.apache.org/core/3_6_1/api/core/org/apache/lucene/queryParser/Q
ueryParser.html

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: Ian Lea [mailto:ian.lea@gmail.com]
> Sent: Tuesday, August 14, 2012 10:39 AM
> To: java-user@lucene.apache.org
> 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
> <zh...@gmail.com> 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: 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


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

Posted by Ian Lea <ia...@gmail.com>.
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 <zh...@gmail.com> 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: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org