Skip to Main Content

Application Development Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Lucene date range search ??

Nirav VarmaSep 9 2014 — edited Sep 15 2014

Hello,

Does anyone know how to perform date range search? I think either my configuration is wrong or the date format.

I am trying the following (also tried using  List<String> rather than passing List<Date>) :

     List<Date> dates = new ArrayList<Date>();

    dates.add(new SimpleDateFormat("yyyyMMddHHmmss").parse(startdate));

    dates.add(new SimpleDateFormat("yyyyMMddHHmmss").parse(enddate));

    dateQ = new QueryExpressionImpl("EndDate", Operation.RANGE_INCLUSIVE, dates);

wherein, EndDate is custom flex attribute created by us not system attribute and values for startdate and enddate are in correct format to avoid parsing error

Lucene configuration for attribute: EndDate - Type:DateTime,  Tokenized:true and Stored:true similar to that of system attribute: updateddate

FatWire Version: 7.6.2

Lucene jar version: lucene-core-2.9.2.jar

Help is appreciated.

Regards,

Guddu

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 13 2014
Added on Sep 9 2014
1 comment
1,198 views