Define "exists"
A. ) Is not declared.
B. ) It is declared, but it has no value. (Empty).

For B) you can use query= -(fieldA:["" TO *]) and it returns all the documents with fieldA empty (but declared in the doc)

Pako

Umar Shah wrote:
hi,
a related question:
is there some way where we can specify action based on
 whether field A exists or not?

-umar

On Fri, Apr 11, 2008 at 8:27 AM, Chris Hostetter <[EMAIL PROTECTED]>
wrote:

If every document will definitely have a value for both fields, you can
do...
               q = query
       &       fq = -(+fieldA:0 +fieldB:0)

...it's more complicated if some docs don't have any value for one or both
fields: if the fields are integers (and not floats) then the easiest thing
to do is use some range queries...

 fq = fieldA:[* TO -1] fieldA:[1 TO *] fieldB:[* TO -1] fieldB:[1 TO *]

...for floats you would have to get really creative with your set logic
... i'm certain it's possible, i'm just not sure off the top of my head
what the fq needs to look like.

-Hoss




Reply via email to