Question: force a field must be matched?

2005-09-15 Thread James Huang
Suppose I have a book index with field="publisher", field="title", etc. I want to search for books only from "Manning", do I have to do anything special? how? Thanks, -James __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protectio

Re: Question: force a field must be matched?

2005-09-15 Thread Jason Haruska
On 9/15/05, James Huang <[EMAIL PROTECTED]> wrote: > > Suppose I have a book index with field="publisher", field="title", etc. > I want to search for books only from "Manning", do I have to do anything > special? how? > add new BooleanClause(new TermQuery(new Term("publisher","Manning")), true,

Re: Question: force a field must be matched?

2005-09-15 Thread James Huang
Thanks Jason. I wonder if that's the same as queryString + " publisher:Manning" and pass on to the query parser? -James --- Jason Haruska <[EMAIL PROTECTED]> wrote: > On 9/15/05, James Huang <[EMAIL PROTECTED]> wrote: > > > > Suppose I have a book index with > field="publisher", field="tit

Re: Question: force a field must be matched?

2005-09-15 Thread Chris Hostetter
: I wonder if that's the same as : : queryString + " publisher:Manning" : : and pass on to the query parser? assuming queryString is a java variable containing your initial query, then you are close, but not quite. If you want to tell QueryParser to make a clause "required" then you have to pre

Re: Question: force a field must be matched?

2005-09-15 Thread James Huang
Yes, "+" is what I missed! Thanks. Suppose there is a book published by 3 publishers (I don't know how that works in real world): // At index time: doc.add( Field.Keyword("publisher", "Manning") ); doc.add( Field.Keyword("publisher", "SAMS") ); doc.add( Field.Keyword("publisher", "O'Reilly"

Re: Question: force a field must be matched?

2005-09-16 Thread Miles Barr
On Thu, 2005-09-15 at 11:56 -0700, James Huang wrote: > Yes, "+" is what I missed! Thanks. > > Suppose there is a book published by 3 publishers (I > don't know how that works in real world): > > // At index time: > doc.add( Field.Keyword("publisher", "Manning") ); > doc.add( Field.Keyword("p

Re: Question: force a field must be matched?

2005-09-16 Thread Erik Hatcher
On Sep 15, 2005, at 12:55 PM, James Huang wrote: Thanks Jason. I wonder if that's the same as queryString + " publisher:Manning" and pass on to the query parser? I will emphasize the other comments made on this regarding the Analyzer. I recommend against programatically adding to the s