unexpected query results (AND and OR)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

unexpected query results (AND and OR)

Jamie Band
Hi there

I need some help in understanding Lucene's query mechanism. I am
receiving unexpected query results when combining terms with AND and OR
operators. We are using Lucene to index emails. Our problem is that when
we execute a search such as '(from:"[hidden email]") and
(to:"[hidden email]")' we are receiving results that do not contain both
[hidden email] and [hidden email]. i.e. There are some results containing
only [hidden email] or [hidden email]. The AND operator does not appear to
work as expected by requiring both terms to appear in the document. We
thought about using the lucene score value to filter exact matches out
but we cannot do this as documents with even scores around 70% are
applicable. Are we using Lucene in the wrong way? Is there something
that we are missing?

Thanks in advance
Jamie




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: unexpected query results (AND and OR)

Jamie Band
I would also like to point out that we also thought about using a filter
but it is being used for other things.

Jamie wrote:

> Hi there
>
> I need some help in understanding Lucene's query mechanism. I am
> receiving unexpected query results when combining terms with AND and
> OR operators. We are using Lucene to index emails. Our problem is that
> when we execute a search such as '(from:"[hidden email]") and
> (to:"[hidden email]")' we are receiving results that do not contain both
> [hidden email] and [hidden email]. i.e. There are some results containing
> only [hidden email] or [hidden email]. The AND operator does not appear to
> work as expected by requiring both terms to appear in the document. We
> thought about using the lucene score value to filter exact matches out
> but we cannot do this as documents with even scores around 70% are
> applicable. Are we using Lucene in the wrong way? Is there something
> that we are missing?
>
> Thanks in advance
> Jamie
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


--
Stimulus Software - MailArchiva
Email Archiving And Compliance
USA Tel: +1-713-366-8072 ext 3
UK Tel: +44-20-80991035 ext 3
Email: [hidden email]
Web: http://www.mailarchiva.com

To receive MailArchiva Enterprise Edition product announcements, send a message to: <[hidden email]>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: unexpected query results (AND and OR)

Erick Erickson
In reply to this post by Jamie Band
I believe you must capitalize the AND. lower-case 'and' is ignored.

you could also construct your own BoolenQuery if you wanted.

I recommend  copy of Luke to interactively examine how queries
are parsed. Also, toString is your friend....

Best
Erick



On Fri, Apr 4, 2008 at 9:41 AM, Jamie <[hidden email]> wrote:

> Hi there
>
> I need some help in understanding Lucene's query mechanism. I am receiving
> unexpected query results when combining terms with AND and OR operators. We
> are using Lucene to index emails. Our problem is that when we execute a
> search such as '(from:"[hidden email]") and (to:"[hidden email]")' we are
> receiving results that do not contain both [hidden email] and [hidden email].
> i.e. There are some results containing only [hidden email] or [hidden email].
> The AND operator does not appear to work as expected by requiring both terms
> to appear in the document. We thought about using the lucene score value to
> filter exact matches out but we cannot do this as documents with even scores
> around 70% are applicable. Are we using Lucene in the wrong way? Is there
> something that we are missing?
>
> Thanks in advance
> Jamie
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>