lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jin Guang Zheng <zhen...@rpi.edu>
Subject Re: Lucene Query
Date Tue, 19 Aug 2014 19:16:57 GMT
Thanks for reply, but won't BooleanQuery return both doc1 and doc2 with
query:

label:States AND label:America AND label:United

Best,
Jin


On Tue, Aug 19, 2014 at 2:07 PM, Tri Cao <tmcao@me.com> wrote:

> given that example, the easy way is a boolean AND query of all the terms:
>
>
> http://lucene.apache.org/core/4_6_0/core/org/apache/lucene/search/BooleanQuery.html
>
> However, if your corpus is more sophisticated you'll find that relevance
> ranking is not always that trivial :)
>
> On Aug 19, 2014, at 11:00 AM, Jin Guang Zheng <zhengj3@rpi.edu> wrote:
>
> Hi,
>
> I am wondering if someone can help me on this:
>
> I have index:
>
> doc 1 -- label: United States of America
>
> doc 2 -- label: United
> doc 2 -- label: America
> doc 2 -- label: States
>
> I am wondering how to generate a query with terms: states united america
>
> so only doc 1 returns.
>
>
> I was thinking SpanNearQuery, but can't make it work.
>
> Thanks,
> Jin
>
>

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