lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Carlson <carl...@bookandhammer.com>
Subject Re: Query
Date Thu, 27 Jun 2002 16:10:27 GMT
You are correct in using the "-" symbol to remove a term from a search
result, but you cannot have that as your only query.

That is Lucene does not support returning all results but the ones that do
not match a certain criteria. If you want to do this, you must add a field
that always exists and then add the no term to that.

So something like

exists:true NOT pradeep

--Peter


On 6/26/02 11:03 PM, "Pradeep Kumar K" <pradeepk@robosoftin.com> wrote:

> 
> Hi
> 
> How to create a query which should search for  documents
> that doesnot containing a certain Term. I used '-' before the
> string to be avoided
> 
> Query  qu= QueryParser.parse("-pradeep","name",new
> StandardAnalyzer());
> 
> I have two documents with 'name'  not equal to 'pradeep'
> but the number of hits returned is 0 but   putting '+'  in the
> above query seems to be returning correct number of hits.
> 
> Regards
> Pradeep
> 
> 
> --------------------------------------------------------------
> Robosoft Technologies, Mangalore, India
> 
> 
> 
> --
> 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