lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ruchi thakur" <ruchithak...@gmail.com>
Subject Re: Query String for a phrase?
Date Mon, 12 Mar 2007 04:27:21 GMT
ok, so does that mean i can use both q1 and q2 for phrase query ie; for
searching words adjacent to each other. Actually that was my only concern,
as i wanted to use q1 for phrase query, rather than q2.
Regards,

On 3/12/07, Steffen Heinrich <lucene-users@atablis.com> wrote:
>
> 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,
> > Ruchi
> > 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message