Mailing List Archive

Basic clause with NOT
Hello,
In Lucene documentation, the query syntax is defined as follows:
Syntax:
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' | '||'

-----------------------------

If I try a search using "NOT sometext" it does not work. Is
it not supported? I think I am following the syntax according to the
documentation. I am trying to get all documents that do not have a given
word.
Thanks in advance for any help.


--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
Re: Basic clause with NOT [ In reply to ]
This is a FAQ.
See http://www.jguru.com/faq/home.jsp?topic=Lucene in a few hours.

The answer is: NOT <query term> queries are not permitted.

Otis


--- Aruna Raghavan <ArunaR@opin.com> wrote:
> Hello,
> In Lucene documentation, the query syntax is defined as follows:
> Syntax:
> 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' | '||'
>
> -----------------------------
>
> If I try a search using "NOT sometext" it does not work. Is
> it not supported? I think I am following the syntax according to the
> documentation. I am trying to get all documents that do not have a
> given
> word.
> Thanks in advance for any help.
>
>
> --
> To unsubscribe, e-mail:
> <mailto:lucene-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:lucene-user-help@jakarta.apache.org>
>


__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
Re: Basic clause with NOT [ In reply to ]
On Fri, Dec 21, 2001 at 03:30:17PM -0800, Otis Gospodnetic wrote:

> The answer is: NOT <query term> queries are not permitted.

Is it impractical (or a speed trap) to add a field with a known value
to all documents, and then search for it alongside the negated query?
I'm not clear if this is the strategy dismissed as "very slow" in the
new FAQ entry.

-nat

--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
Re: Basic clause with NOT [ In reply to ]
See this: http://marc.theaimsgroup.com/?t=100455365600001&r=1&w=2

--- Nathaniel Irons <ndi-l@bumppo.net> wrote:
> On Fri, Dec 21, 2001 at 03:30:17PM -0800, Otis Gospodnetic wrote:
>
> > The answer is: NOT <query term> queries are not permitted.
>
> Is it impractical (or a speed trap) to add a field with a known value
> to all documents, and then search for it alongside the negated query?
> I'm not clear if this is the strategy dismissed as "very slow" in the
> new FAQ entry.
>
> -nat
>
> --
> To unsubscribe, e-mail:
> <mailto:lucene-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:lucene-user-help@jakarta.apache.org>
>


__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

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