cancel
Showing results for 
Search instead for 
Did you mean: 

Lucene ISNULL query

lista
Star Contributor
Star Contributor
Hi all,

does anyone have any in-depth experience with this query?

Basically, if you do a simple query on a repository that is not empty, it will fail miserably with the maxClauseCount error. I could go about setting it higher, but then it's just a matter of time before I hit it again.

Let's imagine a query along the lines of:


ASPECT:"cm:folder" AND ISNULL "cm:barCode"


If you look at what that query produces, you will see something like this:


+(ASPECT:{http://www.contentModel.com/model/content/1.0}folder) +(+MatchAllDocsQuery -(@{http://www.contentModel.com/model/content/1.0}barCode:* @{http://www.contentModel.com/model/content/1.0}barCode:{en}*))


So, it basically removes what it finds with the ISNULL part from the ASPECT part of the query, and since it tries to find all possible values for barCode, it hits the maxClauseCount.

Any way around this?

Thanks!
3 REPLIES 3

mitpatoliya
Star Collaborator
Star Collaborator
I do not think cm:barCode is part of out of box content model. What you are trying to do with this query?
Your first part for query is also not correct as you should be using TYPE instead of aspect.
You need to narrow down to your custom content type in case you want to search within those contents only.

lista
Star Contributor
Star Contributor
I was simply typing those names from my head, for the sake of an example. The problem is in the "barBode:*" part of query, which is obviously a part of how the the whole "ISNULL" part works.

lista
Star Contributor
Star Contributor
For anyone interested, I simply ended up doing a Lucene search without the problematic part, and checking for property existance on found nodes. Any other comments are still welcome.

Cheers!