: 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 prefice it with a "+".
something like...
String userQueryString = ...;
String queryString = userQueryString + " +publisher:Manning";
...is probably what you want.
Alternately, instead of giving QueryParser a string you have built up
from little pieces, I would recommend that you let QueryParser build a
Query just off of the user input, and then either:
a) Filter that query at search time (take a look at the Filter class and
it's subclasses)
b) Modify the Query object returned by the QueryParser -- either adding
a mandatory clause to it if it's a BooleanQuery, or wrapping it in a
new BooleanQuery that already contains your required clause.
-Hoss
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]