Wednesday 23 March 2011 1:47:06 am
Yeah... I've figured it out.. Someone on this forum sayd that [ * TO NOW] or any combination of this will work for dates. For some reason it does not work for me. So where the * comes, I just use some timespan that will not happen. I doubt that articles will be older than 100 years, or unpublish date will be later than 100 years. So I'm using this:
[NOW TO NOW/DAY+100DAY] If attribute unpublish_date is not set, some suggest you set the filter like so:
'-article/unpublish_date:[* TO *]' But it doesn't work for me :) So the solution to my question is: For all articles that are expired:
'article/unpublish_date:[NOW/DAY-100YEAR TO NOW]' And for all that are not expired, and also don't have the unpublis_date attribute set:
'filter', array('or', 'article/unpublish_date:1970-01-01T01\:00\:00Z', 'article/unpublish_date:[NOW TO NOW/DAY+100YEAR]') And that's it, I hope someone else will find this useful.
|