lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <>
Subject Re: Fielded Queries Question
Date Wed, 07 Jul 2010 01:20:13 GMT
That's not the meaning of phrase query at all. Searching for a phrase
implies proximity. That is, searching for name:"Tom Jones" requires that
these two terms appear next to each other, whereas
name:Tom AND name:Jones merely requires that the two terms
appear anywhere in the field, no matter how many other terms
are between them. I.e. indexing "tom sawyer huck finn and steve jones"
in a field would match
name:tom AND name:jones
but would not match
name:"tom jones"

You can control how close phrase terms must be by using the
tilde operator, i.e. name:"tom jones"~3.

Here's a start...


On Tue, Jul 6, 2010 at 4:18 PM, Thomas Nguyen <> wrote:

> Hello All,
> Can someone explain to me how fielded queries work with phrases?  My
> first thought is that the phrase is broken down into terms and those
> terms are then fielded and separated with the AND operator.  An
> example would be the following:
> name:"Tom Jones" --> name:"Tom" AND name:"Jones"
> I found out that isn't correct as the original query didn't returned
> any results while the second query did.  So then I tried changing the
> AND to OR in the second query to see if it's equivalent to the
> original query.  The OR query did return results so it can't be
> equivalent.  Any insight would be helpful.
> - Thanks
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message