lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aruna Raghavan <Aru...@opin.com>
Subject RE: Boolean AND query
Date Thu, 21 Feb 2002 19:19:17 GMT
Daniel,
Thanks for the response but I am going by the definition of the 
Syntax in Lucene FAQ:
Query  ::=  Clause  ( [ Conjunction ] Clause ) *

Where:
Clause ::=  [ Modifier ] [ FieldName ':' ] BasicClause 
	Modifier    ::= '-' | '+' | '!' | 'NOT'
	BasicClause ::= ( Term | Phrase | | PrefixQuery '(' Query ')'
	PrefixQuery ::= Term '*'
	Term        ::= <a-word-or-token-to-match>
	Phrase      ::= '"' Term * '"'

Conjunction ::= 'AND' | 'OR' | '||'

According to the above, AND and OR should work too, right?

-----Original Message-----
From: Daniel Calvo [mailto:dcalvo@ig.com.br]
Sent: Thursday, February 21, 2002 11:12 AM
To: Lucene Users List
Subject: RE: Boolean AND query


Hi,

To achieve what you want, you need to use the required operand (+)

--Daniel 

> -----Original Message-----
> From: Aruna Raghavan [mailto:ArunaR@opin.com]
> Sent: quinta-feira, 21 de fevereiro de 2002 13:44
> To: 'Lucene Users List'
> Subject: Boolean AND query
> 
> 
> Hello,
> Has anyone run into problems with boolean AND query? Basically, I am using
> the following code to do the query to look for 
> 10060 AND 10040
> 
> BooleanQuery bq = new BooleanQuery();
> Analyzer analyzer = new StandardAnalyzer();
> Query query = QueryParser.parse(m_strKeyword, "pageText", analyzer);
>  bq.add(query, true, false);
> 
> In this case, I am just using one query to add to bq but there can be
more. 
> 
> I am getting correct results when 10060 AND 10040 exists in the document.
> But when one of them does not exist, I am still getting the same results.
In
> other words, AND seems to be acting like an OR. I noticed this in the
latest
> RC4 as well as an older lucene build from before lucene joined jakarta.
> 
> Thanks!
> 
> --
> To unsubscribe, e-mail:
<mailto:lucene-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:lucene-user-help@jakarta.apache.org>
> 

--
To unsubscribe, e-mail:
<mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:lucene-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>


Mime
View raw message