lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steffen Heinrich" <lucene-us...@atablis.com>
Subject Re: Query String for a phrase?
Date Sun, 11 Mar 2007 21:06:56 GMT
On 11 Mar 2007 at 22:58, ruchi thakur wrote:

> Thanks a lot for your help..
> below is  a snapshot from the code, am using for search
> org.apache.lucene.analysis.StopAnalyzer sa = new
> org.apache.lucene.analysis.StopAnalyzer();
> org.apache.lucene.analysis.Analyzer analyzer = sa;
> QueryParser parser = new QueryParser(dIndexField, analyzer);
> Query query = parser.parse(sSearchStr);
> hits = is.search(query);
> 
> q1: jakarta&apache  -> BooleanQurey("jakarta" OR/AND "apache")
> q2: "jakarta apache"  -> PhraseQuery("jakarta apache")
> 
> when i use the queries above, i get the same result. This is what i am also
> wondering at.
> For two doccuments d1="jakarta otherword apache" and d2="jakarta apache
> otherword", both q1 and q2 find only d2. ie; query q1 is also looking for
> documents with jakarta apache as one phrase
> 
> Any ideas? I have tested it . Though i will test it again as suggested..
> Regards,
> Reena
> On 3/11/07, Doron Cohen <DORONC@il.ibm.com> wrote:
> 
> > "ruchi thakur" <ruchithakur1@gmail.com> wrote on 11/03/2007 04:36:39:
> >
> > > So just wanted to make sure if
> > >
> > > jakarta&apache  -> jakarta apache
> > > like
> > > "jakarta apache"  -> jakarta apache
> > >
> > > ie; jakarta&apache seaches for phrase jakarta apache
> > > Regards,
> > > Ruchi
> >
> > q1: jakarta&apache  -> BooleanQurey("jakarta" OR/AND "apache")
> > q2: "jakarta apache"  -> PhraseQuery("jakarta apache")
> >
> > For two doccuments d1="jakarta otherword apache" and d2="jakarta apache
> > otherword", q1 would find both documents but q2 would only find d2.
> >
Hi Ruchi,

trying out with Luke and using the StopAnalyzer, reveals that q1gets 
actually also translated to "jakarta apache".
The syntax for the Boolean query should be (with space)
jakarta +apche

Cheers, Steffen


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