You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Ram Peters <ra...@gmail.com> on 2007/05/26 03:28:14 UTC

Search Query AND OR for Title and Description Fields

I have title field and description field indexed.  Now I want to
search for "object oriented programming" either in title "and or"
description using Lucene search query.

How do I do this?

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Search Query AND OR for Title and Description Fields

Posted by Erick Erickson <er...@gmail.com>.
Then I think what you want is something like just assembling a
BooleanQuery like:
(+title:object +title:oriented +title:programming)
(+description:object +description:oriented +description:programming).

Best
Erick

On 5/27/07, Ram Peters <ra...@gmail.com> wrote:
>
> What I like to do is search over multiple fields.  Multiple fields:
> title and description.  I don't want to concatenate the title and
> description field into one and search on that field, because title and
> description have different boosting.
>
> When I search over multiple fields for "object oriented programming",
> it could appear both in title and description or on one of the fields
> (either title or description).
>
>
> http://wiki.apache.org/lucene-java/LuceneFAQ#head-300f0756fdaa71f522c96a868351f716573f2d77
>
> On 26/05/07, Erick Erickson <er...@gmail.com> wrote:
> > This makes little sense. Could you give an example of how
> > you'd like to see things operate?
> >
> > And have you looked at the FAQ for Lucene query syntax?
> >
> > Erick
> >
> > On 5/25/07, Ram Peters <ra...@gmail.com> wrote:
> > >
> > > I have title field and description field indexed.  Now I want to
> > > search for "object oriented programming" either in title "and or"
> > > description using Lucene search query.
> > >
> > > How do I do this?
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > > For additional commands, e-mail: java-user-help@lucene.apache.org
> > >
> > >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: Search Query AND OR for Title and Description Fields

Posted by Ram Peters <ra...@gmail.com>.
What I like to do is search over multiple fields.  Multiple fields:
title and description.  I don't want to concatenate the title and
description field into one and search on that field, because title and
description have different boosting.

When I search over multiple fields for "object oriented programming",
it could appear both in title and description or on one of the fields
(either title or description).

http://wiki.apache.org/lucene-java/LuceneFAQ#head-300f0756fdaa71f522c96a868351f716573f2d77

On 26/05/07, Erick Erickson <er...@gmail.com> wrote:
> This makes little sense. Could you give an example of how
> you'd like to see things operate?
>
> And have you looked at the FAQ for Lucene query syntax?
>
> Erick
>
> On 5/25/07, Ram Peters <ra...@gmail.com> wrote:
> >
> > I have title field and description field indexed.  Now I want to
> > search for "object oriented programming" either in title "and or"
> > description using Lucene search query.
> >
> > How do I do this?
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: java-user-help@lucene.apache.org
> >
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Search Query AND OR for Title and Description Fields

Posted by Erick Erickson <er...@gmail.com>.
This makes little sense. Could you give an example of how
you'd like to see things operate?

And have you looked at the FAQ for Lucene query syntax?

Erick

On 5/25/07, Ram Peters <ra...@gmail.com> wrote:
>
> I have title field and description field indexed.  Now I want to
> search for "object oriented programming" either in title "and or"
> description using Lucene search query.
>
> How do I do this?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>