lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erick Erickson" <erickerick...@gmail.com>
Subject Re: Query String for a phrase?
Date Sun, 11 Mar 2007 16:12:37 GMT
It depends upon your analyzer during both index and search operations.

WhitespaceAnalyzer would do nothing to your string, and
you'd have "jakarta&apache".

StandardAnalyzer would give you two terms, "jakarta" and "apache"
and at query time this would be either jakarta AND apache
or jakarta OR apache, depending on what the default operator is.

and phrase search is something else again. that is, a
PhraseQuery with the term "jakarta apache" would only match the
two words if they were right next to each other.

You'll get a lot more and better help if you tell us what analyzers
you're using <G>...

Erick




On 3/11/07, ruchi thakur <ruchithakur1@gmail.com> wrote:
>
> am sorry , guess "*" caused confusion.
> My question is that, using jakarta&apache am able to search for jakarta
> apache, but
> was confused as no reference to this query String(jakarta&apache) could
> find
> anywhere on net.
>
> 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
>
>
> On 3/11/07, Doron Cohen <DORONC@il.ibm.com> wrote:
> >
> > "ruchi thakur" <ruchithakur1@gmail.com> wrote on 10/03/2007 19:32:14:
> >
> > > does that mean* jakarta&apache* should search for   * jakartaapache*
> >
> > I assume '*' here is for emphasizing the query text, - this is somewhat
> > confusing because '*' is part of Lucene's query syntax for wildcard
> > search.
> > To the question - usually no, but it depends. You could write an
> analyzer
> > that would emit a token jakartaapache for input of jakarta&apache though
> > my
> > guess is that this is not the case, and jakarta&apache and jakartaapache
> > are two distinct words in your index. See the Lucene FAQ, in particular
> "
> > Why am I getting no hits / incorrect hits?", starting with its
> > recommendation to examine query.toString().
> >
> > Hope this helps,
> > Doron
> >
> > > But using *jakarta&apache* am able to search for *jakarta apache* ,
> but
> > was
> > > confused as no reference to this query String(jakarta&apache) could
> find
> > > anywhere on net.
> > >
> > > Regards,
> > > Ruchi
> > > On 3/8/07, Doron Cohen <DORONC@il.ibm.com> wrote:
> > > >
> > > > Most likely the string  jakarta&apache  is analyzed as a single
> word,
> > > > both at indexing time and at search time.
> > > >
> > > > See also "AnalysisParalysis" in Lucene Wiki.
> >
> >
> > ---------------------------------------------------------------------
> > 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