Owen,
Have a look at the QueryParser API. setDefaultOperator :)
However, be aware that you need to construct an instance of
QueryParser and use the instance parse(String) method and not the
static parse(String,String,Analyzer) method.
Erik
On May 17, 2006, at 9:04 PM, [EMAIL PROTECTED] wrote:
I have users that want the search to work like google. So when a
user enters
a query, such as:
Tram Pole
The result should be documents that contains both "tram" and
"pole". At the
moment, the default seems to be documents that contain "tram" or
"pole".
I thought of paring the query before I submit it to lucene and
place "AND"
between each term but this would prevent the user from entering an
OR query
(or any other lucene sytax!).
So I'm stuck. I've been looking at the Analyzers but nothing seems
to do
what I need. This seems such an obvious question that I'm betting that
someone out there has just the right solution.
Cheers,
Owen.
--
View this message in context: http://www.nabble.com/Default-search-
to-AND-rather-than-OR-t1640214.html#a4442682
Sent from the Lucene - Java Developer forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]