Check if a field exists of not in a query

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Check if a field exists of not in a query

Jean-Claude Antonio
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*

Reply | Threaded
Open this post in threaded view
|

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

Erik Hatcher
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*

Reply | Threaded
Open this post in threaded view
|

Lucene

ragia ibrahim

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
Reply | Threaded
Open this post in threaded view
|

Re: Lucene

Grant Ingersoll-2
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


Reply | Threaded
Open this post in threaded view
|

Re: Lucene

ferez
In reply to this post by ragia ibrahim
Dear ragia,

I haven't started to use Lucene yet.

Regards,
Farzad

ragia ibrahim <[hidden email]> 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.