You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@lucene.apache.org by Jean-Claude Antonio <jc...@arcetis.com> on 2007/08/24 10:31:22 UTC

Check if a field exists of not in a query

Hello,

Sorry if this question was already asked, but I could not find subjects 
related to it.
Is it possible in a query to check if a field exists of not.
something like:
myfield:EXIST
or myfield:ANY VALUE

I had a look at the Query Parser Syntax, and I could not find anything 
on the subject.

Thanks in advance.

*Jean-Claude Antonio*


Re: Lucene

Posted by Grant Ingersoll <gs...@apache.org>.
http://lucene.apache.org/java/docs/index.html is the place to start.   
 From there, just keep digging down deeper into the site, until you  
get into the code.  Lucene in Action is also an excellent book to  
start with on many of your questions.

-Grant

On Aug 26, 2007, at 1:08 AM, ragia ibrahim wrote:

>
> Hello
> I am lookin genral inforamtion about lucene
> How to  you load free text into Lucene?
>   How to you load fielded text?
>  What format options are there?
>   How does it handle various character sets, stoplists, stemming,  
> etc.?
>  What data structures does it use?
>               To store and index fielded data
>               To maintain term weights
>
> please if you can direct me to a URL answe these questions
> thanks in advance.
> Ragia
> _________________________________________________________________
> Connect to the next generation of MSN Messenger
> http://imagine-msn.com/messenger/launch80/default.aspx?locale=en- 
> us&source=wlmailtagline

--------------------------
Grant Ingersoll
http://lucene.grantingersoll.com

Lucene Helpful Hints:
http://wiki.apache.org/lucene-java/BasicsOfPerformance
http://wiki.apache.org/lucene-java/LuceneFAQ



Re: Lucene

Posted by Farzad Mahdikhani <fa...@yahoo.com>.
Dear ragia,

I haven't started to use Lucene yet.

Regards,
Farzad

ragia ibrahim <ra...@hotmail.com> wrote: 
Hello
I am lookin genral inforamtion about lucene 
How to  you load free text into Lucene? 
  How to you load fielded text? 
 What format options are there? 
  How does it handle various character sets, stoplists, stemming, etc.?
 What data structures does it use?
              To store and index fielded data
              To maintain term weights
 
please if you can direct me to a URL answe these questions
thanks in advance.
Ragia
_________________________________________________________________
Connect to the next generation of MSN Messenger 
http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline

       
---------------------------------
Boardwalk for $500? In 2007? Ha! 
Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.

Lucene

Posted by ragia ibrahim <ra...@hotmail.com>.
Hello
I am lookin genral inforamtion about lucene 
How to  you load free text into Lucene? 
  How to you load fielded text? 
 What format options are there? 
  How does it handle various character sets, stoplists, stemming, etc.?
 What data structures does it use?
              To store and index fielded data
              To maintain term weights
 
please if you can direct me to a URL answe these questions
thanks in advance.
Ragia
_________________________________________________________________
Connect to the next generation of MSN Messenger 
http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline

Re: Check if a field exists of not in a query

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
In the latest version of Lucene you can make a query like of myfield: 
[* TO *] to find all documents that have the field.

I've been using Solr so much lately that I'm used to doing the  
inverse to find ones that don't have a value for a field also:

	-myfield:[* TO *]

But Lucene itself does not support purely negative queries so you can  
combine that with a match-all-docs query:

	*:* AND -myfield:[* TO *]


   Erik

On Aug 24, 2007, at 4:31 AM, Jean-Claude Antonio wrote:

> Hello,
>
> Sorry if this question was already asked, but I could not find  
> subjects related to it.
> Is it possible in a query to check if a field exists of not.
> something like:
> myfield:EXIST
> or myfield:ANY VALUE
>
> I had a look at the Query Parser Syntax, and I could not find  
> anything on the subject.
>
> Thanks in advance.
>
> *Jean-Claude Antonio*