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: Boolean Query Issue
Date Wed, 28 May 2008 13:39:36 GMT
It's unclear what you *should* expect. How is your data
distributed?

In other words, how many documents do you have? In this example,
for instance,
1. TTL:data AND TTL:store OR TTL:variable => 3,733 results
it considered the TTL:data part only.

it's perfecily reasonable if every document that had "variable" in the
field *also* has "data" and "store" in the field. So your numbers
don't give us much to work with.....

Remember, though, that Lucene syntax isn't a pure boolean syntax. See

http://wiki.apache.org/lucene-java/BooleanQuerySyntax

And when in doubt parenthesize <G>...

Best
Erick

On Wed, May 28, 2008 at 7:44 AM, Sonu Sudhakar <sonusr@gmail.com> wrote:

> Hi,
>
> I have some issue with boolean queries.
>
> I am using Lucene-core-2.3.1.
>
> I have done test on boolean query with 3 terms (data, store, variable) in
> my
> TTL field. The TTL field is indexed and searched using StandardAnalyzer.
>
> The three terms when searched individually gave the following result
>
> 1. TTL:data  => 3,733 results
> 2. TTL:store  => 76 results
> 3. TTL:variable  => 1,496 results
>
> But found issue when combining these terms with boolean operators.
>
> e.g.
> 1. TTL:data AND TTL:store OR TTL:variable => 3,733 results
> it considered the TTL:data part only.
>
> 2. TTL:store AND TTL:data OR TTL:variable => 76 results
> it considered  the TTL:store part only.
>
> 3. TTL:variable AND TTL:data OR  TTL:store => 1,496 results
> it considered  the TTL:variable part only.
>
> But I am getting correct result when combining terms with 'AND' operator. I
> think the issue is with 'OR' operator.
>
>
> Could anybody give an explanation for this behavior of lucene?
> Could you give suggestions to rectify this?
>
> Thanks,
> Sonu
>

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