Mats,
I believe when you call parser.parse with the Analyzer again you reset the
state of default operator
The following code should do what you want.
QueryParser parser = new QueryParser( FIELD, service.getAnalyzer());
parser.setOperator(QueryParser.DEFAULT_OPERATOR_AND);
Query query = parser.parse(queryString);
Regards,
Paul
-----Original Message-----
From: Mats Nyberg [mailto:[EMAIL PROTECTED]
Sent: 18 February 2004 11:06
To: Lucene Users List
Subject: status of AND as default logical operator for QueryParser
what is the status of the default operator feature of QueryParser?
i want to have a lucene enabled app using AND as it's default operator using
the code:
QueryParser parser = new QueryParser(FIELD, service.getAnalyzer());
parser.setOperator(parser.DEFAULT_OPERATOR_AND);
Query query = parser.parse(queryString, FIELD, service.getAnalyzer());
results are however not as expected but rather the QueryParser still uses
OR.
is this not the way i am supposed to use the feature?
why is it not working?
--
Mats Nyberg
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
DISCLAIMER:
The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this message
by anyone else is unauthorised. If you are not the intended recipient, any
disclosure, copying, or distribution of the message, or any action or
omission taken by you in reliance on it, is prohibited and may be unlawful.
Please immediately contact the sender if you have received this message in
error.
Thank you.
Valid Information Systems Limited. Address: Morline House, 160 London
Road, Barking, Essex, IG11 8BB.
http://www.valinf.com Tel: +44 (0) 20 8215 1414 Fax: +44 (0) 20 8215 2040
-----------------------------------------
Be a part of Summit 2004 Hummingbird's Worldwide Conference & Technology
Showcase February 22-25, 2004 The Westin Diplomat Resort, Hollywood,
Florida, Visit our Web Site: http://www.hummingbird.com/summit for more
information.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]