Not entirely true - thats the case in Lucene, but in Solr, top level queries *can* start with minus or not. They cannot if they are nested.
Both *:* AND -fieldX:[* TO *] and -fieldX:[* TO *] are the same in Solr. -- - Mark http://www.lucidimagination.com Lance Norskog wrote: > Queries that start with minus or NOT don't work. You have to do this: > *:* AND -fieldX:[* TO *] > > On Wed, Feb 3, 2010 at 5:04 AM, Frederico Azeiteiro > <frederico.azeite...@cision.com> wrote: > >> Hum, strange.. I reindexed some docs with the field corrected. >> >> Now I'm sure the field is filled because: >> >> "fieldX:(*a*)" returns docs. >> >> But "fieldX:[* TO *]" is returning the same as "*.*" (all results) >> >> I tried with "-fieldX:[* TO *]" and I get no results at all. >> >> I wonder if someone has tried this before with success? >> >> The field is indexed as string, indexed=true and stored=true. >> >> Thanks, >> Frederico >> >> -----Original Message----- >> From: Ahmet Arslan [mailto:iori...@yahoo.com] >> Sent: quarta-feira, 3 de Fevereiro de 2010 11:48 >> To: solr-user@lucene.apache.org >> Subject: Re: query all filled field? >> >> >> >>> Is it possible to query some field in order to get only not >>> empty >>> documents? >>> >>> >>> >>> All documents where field x is filled? >>> >> Yes. q=x:[* TO *] will bring documents that has non-empty x field. >> >> >> >> >> > > > >