cancel
Showing results for 
Search instead for 
Did you mean: 

porperty : NULL or unavailable in Lucene search

ajansen
Champ in-the-making
Champ in-the-making
I'm trying to build a query which also has to check for a property being NULL (or unavailable) but I have no idea how to do this.
Every test is resulting in 0 result in every way I build the Query.

Any help would be appreciated.
5 REPLIES 5

andy
Champ on-the-rise
Champ on-the-rise
Hi

You can use queries like ISNULL:"cm:name".

The performance may not be great, and could be improved, but it will work.

Andy

putodemonio
Champ in-the-making
Champ in-the-making
Hi!

I'm trying to find nodes with property fechapublicacion in namespase cice.salaprensa.model without value. I've try many versions, but it doesn't work anyway:


ISNULL:"@\\{cice.salaprensa.model\\}fechapublicacion"
ISNULL:"cm:fechapublicacion"
ISNULL:"\\{cice.salaprensa.model\\}fechapublicacion"
ISNULL:"cm:\\{cice.salaprensa.model\\}fechapublicacion"
ISNULL:"cm:@\\{cice.salaprensa.model\\}fechapublicacion"
ISNULL:"@cm:\\{cice.salaprensa.model\\}fechapublicacion"

Please, may anybody help me!!!!  :?  :?

andy
Champ on-the-rise
Champ on-the-rise
Hi

It should work with
ISNULL:"cm:content"
ISNULL:"QName"

The tests use the long QName form.

It will not find nodes that are not supposed to have the attribute.
So there is also a type check generated ….

The above will find nodes for which cm:content is null and the node is of a type which could have cm:content. So if your property is linked to an aspect, it will only find nodes that do not have the property but have got the aspect applied.

Andy

pl_componize
Champ in-the-making
Champ in-the-making
Hi

You can use queries like ISNULL:"cm:name".

The performance may not be great, and could be improved, but it will work.

Andy

We have issues with ISNULL performance (org.apache.lucene.search.BooleanQuery$TooManyClauses), what suggestion do you have in this regard?

thank you

I've the same issue with Alfresco3. I know it is a old post but if someone have a solution.
I changed the query to use +@XXX:
  • it work but the +ISNULL and +ISNOTNULL should work but it is interpreted as an OR in all my terme. It should be an AND