Yes, I believe that it is entirely possible. You can nest and link
boolean clauses all you want: your example query would be a boolean with
two top level clauses, one required to be there and one required not to
be there. The second top level clause would itself be a boolean query
with two two clauses, both with a SHOULD. Now, what I think happens (I
haven't looked myself) is that the type:product will score a document
positively if found, but the NOT clause will score a document to 0 if
either of it's sub-clauses are found. Those 0 scores will not return as
hits. Now notice that if you just have "NOT(name:"toto" OR name:"tit")"
ALL of the docs will score 0 one way or another- the docs not found will
be 0 and docs found will be scored 0 by the NOT...so you will not get a
result. Now if you use the special query that matches all docs, and then
use a NOT query...the not query will work as expected...all docs will
get a positive score, but the NOT query will 0 out those in the MUST_NOT
clause.
I am an unclear kind of guy, so I hope that gives some help.
- Mark
hawat23 wrote:
Thanks you for your answer.
But, is it possible to group clauses with a "not". exemple:
type:product NOT (name:"toto" OR name:"titi") ??
Christophe
Mark Miller a écrit :
Personally, I think of it as not a 'not' operator, but more a 'but
not' or 'and not' operator. Thats not totally the case I believe, but
gives you semantics that work. Truly I think that each part of the
query creates a score and the NOT query scores 0. That gives a
different result than a boolean system. More than a few times it has
been mentioned that Lucene is a scoring system and not a boolean system.
- Mark
christophe leroy wrote:
Hello,
I don't understand how to use "not" with Lucene. I
think that it is not a boolean not. I read the
documentation but it is not clear enough on how the
"not" works.
For example, I tried to do this request:
type:product
--> I got 100 responses. It is normal. Then, I tried
this request:
type:product AND name:test --> I got 1 response. It is normal too.
And when I
tried this request:
type:product AND (name:test OR NOT name:test)
--> I got 1 response only. I should normally get 100
responses if the "not" was a boolean not.
Could you explain me how the "not" works?
Thank in advance,
Christophe
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos
questions ! Profitez des connaissances, des opinions et des
expériences des internautes sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.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]
---------------------------------------------------------------------
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]