lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Materna, Wolf-Dietrich (empolis B)" <Wolf-Dietrich.Mate...@empolis.com>
Subject RE: Implementation of 'NOT' in the Lucene.
Date Thu, 15 Aug 2002 08:55:50 GMT
Hello,
[...]
> The basic scenario is this: I have two files (single line 
> files) and am running them through the demo application.
> 
> file1: abc def 
> 
> file1: def ghi
> 
> I then run the query:
> 
> -(def)
> and get the result:
> 
> Searching for: -def
> 0 total matching documents
[...]
Sorry, this will not work, because "NOT" is evaluated on a set of documents
selected by other
parts of the query. You query contains only this exclude filter, so no
document is selected
and the result remains empty.
See also at http://jakarta.apache.org/lucene/docs/queryparsersyntax.html the
last note about "NOT".

In order to make it work you have to write your own query parser and add an
dummy field
"dummy_field" contains the same value for all documents, e.g. "empty". Your
parser have to
change the original query "-def" into "dummy:empty -def" only if the query
contains nothing
else.
But this solutions will be probaly to slow for real applications. There is
no good way to deal
such queries for large databases.
Regards,
	Wolf-Dietrich Materna

-- 
Wolf-Dietrich Materna
Development
 
empolis GmbH
Bertelsmann MOHN Media Group
Kekul├ęstr. 7 
12489 Berlin, Germany
 
phone :  +49-30-6780-6510
fax :    +49-30-6780-6549
 
<mailto:Wolf-Dietrich.Materna@empolis.com> <http://www.empolis.com>

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


Mime
View raw message