Xpath selectnodes query for given date

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2013 03:22 AM
Friends,
I have query which runs using TYPE filter/property value filter and date range filter.
Which runs fine on LUCENE.
I want same query to be run using XPATH selectNodes query in java.
e.g.
/app:company_home/cm:T3/cm:Trade/cm:test_9b8adc70-6a83-4104-8783-53d569b04801/cm:Foods/*/*[subtypeOf('t3:test')
and @t3:endDate>='2013-04-10T00:00:00' ]
Every time I got zero results. I tried using different date formatter but there is no luck here.
Can anyone tell me how to run this (endDate greator than or equals given date in query)
I have query which runs using TYPE filter/property value filter and date range filter.
Which runs fine on LUCENE.
I want same query to be run using XPATH selectNodes query in java.
e.g.
/app:company_home/cm:T3/cm:Trade/cm:test_9b8adc70-6a83-4104-8783-53d569b04801/cm:Foods/*/*[subtypeOf('t3:test')
and @t3:endDate>='2013-04-10T00:00:00' ]
Every time I got zero results. I tried using different date formatter but there is no luck here.
Can anyone tell me how to run this (endDate greator than or equals given date in query)
Labels:
- Labels:
-
Archive
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2013 05:38 AM
How about this:
search.selectNodes("//*[number(translate(substring(@cm:created,1,10),'-',''))>20130711]");
This is to compare the date only not a full timestamp, but they idea with be applicable to timestamps as well.
search.selectNodes("//*[number(translate(substring(@cm:created,1,10),'-',''))>20130711]");
This is to compare the date only not a full timestamp, but they idea with be applicable to timestamps as well.
