Re: Multiple field searching

2002-03-24 Thread Peter Carlson

HI,
The AND is not quite the same as +, the AND puts a + next to the previous
and next word.
That is foo AND bar is equivlent to +foo +bar
If you just said foo +bar then you have foo optional and bar required.

Slight difference.

>From looking at the queryParser a while ago the {} characters are exclusive
(or maybe it's inclusive) range query operators, similar to [].  I don't
think they make sense here.

--Peter

On 3/21/02 4:30 AM, "Kelvin Tan" <[EMAIL PROTECTED]> wrote:

> hmmm...really?
> 
> My impression was that the "AND"s are treated equivalently with "+"s by the
> parser, so they're redundant. The "{" and "}"s aren't part of the syntax,
> are they?
> 
> Kelvin
> - Original Message -
> From: "Mehran Mehr" <[EMAIL PROTECTED]>
> To: "Lucene Users List" <[EMAIL PROTECTED]>; "Kelvin Tan"
> <[EMAIL PROTECTED]>
> Sent: Thursday, March 21, 2002 8:11 PM
> Subject: Re: Multiple field searching
> 
> 
>> this is the right syntax:
>> 
>> +(keyword:{computers}) AND +(subject:{News}) AND
>> content:xml
>> 
>> 
>> __
>> Do You Yahoo!?
>> Yahoo! Movies - coverage of the 74th Academy Awards®
>> http://movies.yahoo.com/
>> 
>> --
>> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
>> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: Multiple field searching

2002-03-21 Thread Kelvin Tan


- Original Message -
From: "Otis Gospodnetic" <[EMAIL PROTECTED]>
To: "Lucene Users List" <[EMAIL PROTECTED]>
Sent: Friday, March 22, 2002 1:24 AM
Subject: Re: Multiple field searching


>
> --- Kelvin Tan <[EMAIL PROTECTED]> wrote:
> > hmmm...really?
> >
> > My impression was that the "AND"s are treated equivalently with "+"s
> > by the
> > parser, so they're redundant.
>
> Correct.
>
> > The "{" and "}"s aren't part of the syntax, are they?
>
> I was wondering where those came from.
> I don't think I've seen them in QueryParser.jj.

It could possibly be the documentation in
MultiFieldQueryParser...

/**
 * 
 * Parses a query which searches on the fields specified.
 * 
 * If x fields are specified, this effectively constructs:
 * 
 * 
 * ({field1}:{query}) ({field2}:{query})
({field3}:{query})...({fieldx}:{query})
 * 
 * 
 *
 * @param query Query string to parse
 * @param fields Fields to search on
 * @param analyzer Analyzer to use
 */

Kelvin

>
> Otis
>
> > - Original Message -
> > From: "Mehran Mehr" <[EMAIL PROTECTED]>
> > To: "Lucene Users List" <[EMAIL PROTECTED]>; "Kelvin
> > Tan"
> > <[EMAIL PROTECTED]>
> > Sent: Thursday, March 21, 2002 8:11 PM
> > Subject: Re: Multiple field searching
> >
> >
> > > this is the right syntax:
> > >
> > > +(keyword:{computers}) AND +(subject:{News}) AND
> > > content:xml
> > >
> > >
> > > __
> > > Do You Yahoo!?
> > > Yahoo! Movies - coverage of the 74th Academy Awards®
> > > http://movies.yahoo.com/
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> >
>
>
> __
> Do You Yahoo!?
> Yahoo! Movies - coverage of the 74th Academy Awards®
> http://movies.yahoo.com/
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: Multiple field searching

2002-03-21 Thread Otis Gospodnetic


--- Kelvin Tan <[EMAIL PROTECTED]> wrote:
> hmmm...really?
> 
> My impression was that the "AND"s are treated equivalently with "+"s
> by the
> parser, so they're redundant. 

Correct.

> The "{" and "}"s aren't part of the syntax, are they?

I was wondering where those came from.
I don't think I've seen them in QueryParser.jj.

Otis

> - Original Message -
> From: "Mehran Mehr" <[EMAIL PROTECTED]>
> To: "Lucene Users List" <[EMAIL PROTECTED]>; "Kelvin
> Tan"
> <[EMAIL PROTECTED]>
> Sent: Thursday, March 21, 2002 8:11 PM
> Subject: Re: Multiple field searching
> 
> 
> > this is the right syntax:
> >
> > +(keyword:{computers}) AND +(subject:{News}) AND
> > content:xml
> >
> >
> > __
> > Do You Yahoo!?
> > Yahoo! Movies - coverage of the 74th Academy Awards®
> > http://movies.yahoo.com/
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 


__
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: Multiple field searching

2002-03-21 Thread Kelvin Tan

hmmm...really?

My impression was that the "AND"s are treated equivalently with "+"s by the
parser, so they're redundant. The "{" and "}"s aren't part of the syntax,
are they?

Kelvin
- Original Message -
From: "Mehran Mehr" <[EMAIL PROTECTED]>
To: "Lucene Users List" <[EMAIL PROTECTED]>; "Kelvin Tan"
<[EMAIL PROTECTED]>
Sent: Thursday, March 21, 2002 8:11 PM
Subject: Re: Multiple field searching


> this is the right syntax:
>
> +(keyword:{computers}) AND +(subject:{News}) AND
> content:xml
>
>
> __
> Do You Yahoo!?
> Yahoo! Movies - coverage of the 74th Academy Awards®
> http://movies.yahoo.com/
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: Multiple field searching

2002-03-21 Thread Mehran Mehr

this is the right syntax:

+(keyword:{computers}) AND +(subject:{News}) AND
content:xml


__
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Multiple field searching

2002-03-20 Thread Kelvin Tan


- Original Message -
From: "Otis Gospodnetic" <[EMAIL PROTECTED]>
To: "Lucene Users List" <[EMAIL PROTECTED]>; "Kelvin Tan"
<[EMAIL PROTECTED]>
Sent: Thursday, March 21, 2002 2:13 PM
Subject: Re: Multiple field searching


> Kelvin,
>
> Right now I can't imagine a situation where one would need to pass
> multiple query strings in.  I certainly don't need it anywhere where I
> use Lucene, at least not yet.  So I'd say hold off with that addition
> unless people say they really need it.  Couldn't one always just call
> the parse method multiple times with a different query string each
> time, and then combine returned Query instances?
>

Otis,

I suppose that's possible.

Actually if you need to construct complex multi-field boolean queries via a
web-based form, my recommendation is to use client-side Javascript. I posted
one such script a while back (for the life of me I don't know why it slipped
my mind about it). The difficulty, IMHO, is not getting QueryParser to
construct the query, but making query construction by the end-user simple
enough and idiot-proof...:)

Regards,
Kelvin


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: Multiple field searching

2002-03-20 Thread Otis Gospodnetic

Kelvin,

Right now I can't imagine a situation where one would need to pass
multiple query strings in.  I certainly don't need it anywhere where I
use Lucene, at least not yet.  So I'd say hold off with that addition
unless people say they really need it.  Couldn't one always just call
the parse method multiple times with a different query string each
time, and then combine returned Query instances?

Otis

--- Kelvin Tan <[EMAIL PROTECTED]> wrote:
> Tate,
> 
> The correct syntax is something like +(keyword:computers)
> -(subject:News).
> 
> HTH.
> 
> Maybe it would be helpful to add parse(String[] query, String[]
> fields,
> Analyzer analyzer) methods into MultiFieldQueryParser? What do you
> think
> Otis?
> 
> Kelvin
> - Original Message -
> From: "Tate Jones" <[EMAIL PROTECTED]>
> To: "Lucene Users List" <[EMAIL PROTECTED]>
> Sent: Wednesday, March 20, 2002 3:36 PM
> Subject: Multiple field searching
> 
> 
> > hi,
> >
> > I am trying to search across multiple fields using the following
> query
> >
> > +keyword:computers +subject:News content:xml
> > or
> > +(keyword:{computers}) +(subject:{News}) content:xml
> >
> > i have added the fields to the document correctly.
> >
> > Have also tried using the MutipleFieldQueryParser without success.
> >
> > The only query that works is, which is not correct as they are OR's
> > keyword:computers subject:IT content:xml
> >
> > Is anyone having the same problems
> >
> > Thanks in advance
> > Tate
> >
> >
> > --
> > To unsubscribe, e-mail:
> 
> > For additional commands, e-mail:
> 
> >
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Multiple field searching

2002-03-20 Thread Kelvin Tan

Tate,


> Could not see how the MultiFieldQueryParser could take in multiple
queries. ie.  SUBJECT, KEYWORD & CONTENT field
> have different values to be queried.  It only takes a single query.

You're right in that it doesn't. What I'm wondering right now, is if that's
a reasonably common request to warrant its inclusion into the
MultiFieldQueryParser class...

Regards,
Kelvin

>
> On Wed, 20 Mar 2002 17:58, Otis Gospodnetic wrote:
> > I'm using MultiTermQueryParser and it works for me.
> >
> > Otis
> >
> > --- Tate Jones <[EMAIL PROTECTED]> wrote:
> > > hi,
> > >
> > > I am trying to search across multiple fields using the following
> > > query
> > >
> > > +keyword:computers +subject:News content:xml
> > > or
> > > +(keyword:{computers}) +(subject:{News}) content:xml
> > >
> > > i have added the fields to the document correctly.
> > >
> > > Have also tried using the MutipleFieldQueryParser without success.
> > >
> > > The only query that works is, which is not correct as they are OR's
> > > keyword:computers subject:IT content:xml
> > >
> > > Is anyone having the same problems
> > >
> > > Thanks in advance
> > > Tate
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > 
> > > For additional commands, e-mail:
> > > 
> >
> > __
> > Do You Yahoo!?
> > Yahoo! Sports - live college hoops coverage
> > http://sports.yahoo.com/
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>
>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Multiple field searching

2002-03-20 Thread Tate Jones

Thanks for all your help.

The only way i could get it to work was the following

  BooleanQuery bQuery = new BooleanQuery();

  TermQuery tSubject   = new TermQuery( new Term( SUBJECT_KEY, subject ));
  TermQuery tKeyword = new TermQuery( new Term( KEYWORD_KEY,  keyword ));

  bQuery.add( tSubject, true, false );
  bQuery.add( tkeyword, true, false );

  Query qContent = QueryParser.parse( literal, CONTENT_KEY, analyzer );
  bQuery.add( qContent, false, false );

  //Perform query
  hits = indexSearcher.search(bQuery);

  // debug logging
  if (logger.isDebugEnabled()) {

logger.debug("Searching the fulltext string index pool with '" +
  bQuery.toString(CONTENT_KEY)+"'" );
  }

Could not see how the MultiFieldQueryParser could take in multiple queries. ie.  
SUBJECT, KEYWORD & CONTENT field
have different values to be queried.  It only takes a single query.

On Wed, 20 Mar 2002 17:58, Otis Gospodnetic wrote:
> I'm using MultiTermQueryParser and it works for me.
>
> Otis
>
> --- Tate Jones <[EMAIL PROTECTED]> wrote:
> > hi,
> >
> > I am trying to search across multiple fields using the following
> > query
> >
> > +keyword:computers +subject:News content:xml
> > or
> > +(keyword:{computers}) +(subject:{News}) content:xml
> >
> > i have added the fields to the document correctly.
> >
> > Have also tried using the MutipleFieldQueryParser without success.
> >
> > The only query that works is, which is not correct as they are OR's
> > keyword:computers subject:IT content:xml
> >
> > Is anyone having the same problems
> >
> > Thanks in advance
> > Tate
> >
> >
> > --
> > To unsubscribe, e-mail:
> > 
> > For additional commands, e-mail:
> > 
>
> __
> Do You Yahoo!?
> Yahoo! Sports - live college hoops coverage
> http://sports.yahoo.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Multiple field searching

2002-03-20 Thread Aruna Raghavan

I use a BooleanQuery and add individual queries to it, it is working for me.

-Original Message-
From: Otis Gospodnetic [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 20, 2002 1:59 AM
To: Lucene Users List; [EMAIL PROTECTED]
Subject: Re: Multiple field searching


I'm using MultiTermQueryParser and it works for me.

Otis

--- Tate Jones <[EMAIL PROTECTED]> wrote:
> hi,
> 
> I am trying to search across multiple fields using the following
> query
> 
> +keyword:computers +subject:News content:xml
> or
> +(keyword:{computers}) +(subject:{News}) content:xml
> 
> i have added the fields to the document correctly. 
> 
> Have also tried using the MutipleFieldQueryParser without success.
> 
> The only query that works is, which is not correct as they are OR's
> keyword:computers subject:IT content:xml
> 
> Is anyone having the same problems
> 
> Thanks in advance
> Tate
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 


__
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: Multiple field searching

2002-03-19 Thread Otis Gospodnetic

I'm using MultiTermQueryParser and it works for me.

Otis

--- Tate Jones <[EMAIL PROTECTED]> wrote:
> hi,
> 
> I am trying to search across multiple fields using the following
> query
> 
> +keyword:computers +subject:News content:xml
> or
> +(keyword:{computers}) +(subject:{News}) content:xml
> 
> i have added the fields to the document correctly. 
> 
> Have also tried using the MutipleFieldQueryParser without success.
> 
> The only query that works is, which is not correct as they are OR's
> keyword:computers subject:IT content:xml
> 
> Is anyone having the same problems
> 
> Thanks in advance
> Tate
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Multiple field searching

2002-03-19 Thread Kelvin Tan

Tate,

The correct syntax is something like +(keyword:computers) -(subject:News).

HTH.

Maybe it would be helpful to add parse(String[] query, String[] fields,
Analyzer analyzer) methods into MultiFieldQueryParser? What do you think
Otis?

Kelvin
- Original Message -
From: "Tate Jones" <[EMAIL PROTECTED]>
To: "Lucene Users List" <[EMAIL PROTECTED]>
Sent: Wednesday, March 20, 2002 3:36 PM
Subject: Multiple field searching


> hi,
>
> I am trying to search across multiple fields using the following query
>
> +keyword:computers +subject:News content:xml
> or
> +(keyword:{computers}) +(subject:{News}) content:xml
>
> i have added the fields to the document correctly.
>
> Have also tried using the MutipleFieldQueryParser without success.
>
> The only query that works is, which is not correct as they are OR's
> keyword:computers subject:IT content:xml
>
> Is anyone having the same problems
>
> Thanks in advance
> Tate
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: