jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Herman" <MHer...@NBME.org>
Subject RE: IS NULL
Date Mon, 29 Aug 2011 16:47:43 GMT
First of all, by "document" you mean node, and "field" you mean property of a
node right?

Here is the structure I'm testing with (@ indicates property):
/nullproptest (nt:unstructured)
/nullproptest/a (nt:unstructured)
/nullproptest/a@important = "I'm here" (String)
/nullproptest/b (nt:unstructured)
/nullproptest/c (nt:unstructured)
/nullproptest/c@important = "" (empty string)

(Note:  b does have the "important" property:)

Query: SELECT * FROM [nt:unstructured] WHERE [nt:unstructured].important IS
NULL AND ISDESCENDANTNODE([/nullproptest]) ORDER BY SCORE() DESC
Returns: /nullproptest/b

Query: SELECT * FROM [nt:unstructured] WHERE [nt:unstructured].important IS
NOT NULL AND ISDESCENDANTNODE([/nullproptest]) ORDER BY SCORE() DESC
Returns: /nullproptest/a, /nullproptest/c

Query: SELECT * FROM [nt:unstructured] WHERE [nt:unstructured].important <>
"" AND ISDESCENDANTNODE([/nullproptest]) ORDER BY SCORE() DESC
Returns: /nullproptest/a

-----Original Message-----
From: Lukas Kahwe Smith [mailto:mls@pooteeweet.org] 
Sent: Monday, August 29, 2011 10:45 AM
To: users@jackrabbit.apache.org
Subject: Re: IS NULL


On Aug 29, 2011, at 16:40 , Lukas Kahwe Smith wrote:

> 
> On Aug 29, 2011, at 16:37 , Mark Herman wrote:
> 
>> Are you sure they are nt:unstructured? Maybe try nt:base and see if you
get
>> them.  Also try IS NOT NULL, the results from that might tell you
something.
> 
> 
> we only have nt:unstructured .. and yes IS NOT NULL seems to work fine. we
are using version 2.2.8 with a few patches, none of them related to search
though. but if it works for you then i think it must be some other freak
issue in our code some where, some how .. so thanks for the feedback.


just to confirm .. using IS NULL on a non existent field, you get a matches?

aka

SELECT * FROM [nt:unstructured] WHERE
[nt:unstructured].thisfieldexistsinnodocumentanywhere IS NULL ORDER BY
SCORE() DESC

regards,
Lukas Kahwe Smith
mls@pooteeweet.org




Mime
View raw message