[SOLVED] Empty or null description in Lucene query

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2014 09:21 AM
Hi all,
I want to write Lucene query that will return all content which has empty or null cm:description property. Is it possible to do that?
Thanks…
I want to write Lucene query that will return all content which has empty or null cm:description property. Is it possible to do that?
Thanks…
Labels:
- Labels:
-
Archive
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2014 11:47 AM
You can try to use queries like ISNULL:"{http://www.alfresco.org/model/content/1.0}name" or ISNULL:"cm:name"

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2014 04:03 PM
Thanks kaynezhang, this will work for me.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2015 02:02 AM
Hi Kaynezhang,
Can we use above mentioned query (ISNULL:"{http://www.alfresco.org/model/content/1.0}name" or ISNULL:"cm:name") to write a query using 'org.apache.lucene.search.Query' class. It would be a great help if you can explain with a example code snippet.
Thanks,
Chetan
Can we use above mentioned query (ISNULL:"{http://www.alfresco.org/model/content/1.0}name" or ISNULL:"cm:name") to write a query using 'org.apache.lucene.search.Query' class. It would be a great help if you can explain with a example code snippet.
Thanks,
Chetan

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2014 08:47 AM
Hi all,
one update it does not work for empty property values just for NULL property values. Is there any way to find empty properties?
Thanks
one update it does not work for empty property values just for NULL property values. Is there any way to find empty properties?
Thanks
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2014 10:37 AM
Lucene/Solr does not support searching for empty values,so if you want search some field with null value ,you can define a default value(for example "none") in your model.then you can search for the default value.
If you really want to search empty field ,you can try following code
It is not a good way ,it has low performance.
If you really want to search empty field ,you can try following code
*:* AND -@cm\:name:
It is not a good way ,it has low performance.
