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 Sun, 11 Mar 2007 17:28:11 GMT
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.
>
>
>
> ---------------------------------------------------------------------
> 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