Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
TeamSite
TeamSite, LiveSite and OpenDeploy
TS Search Date Issue
Migrateduser
Hi,
I have a requirement where I want to search a content that is getting expired using CSSDK Search API.
Problem faced:
OOTB search is giving results but not getting results using CSSDK Search API for the custom date EA.
I have the expire date set in field mapping as below:
fieldName : TeamSite/Metadata/Expire_Date
fieldType : date
formatString : yyyy-MM-dd
fieldStorage : CustomDate1
I can see that OOTB search converts the date to time when executing the query:
name : TeamSite/Metadata/Expire_Date
value : ![CDATA[1361989800000]]
In my java class I am also converting the string date (from calendar) to time using java date utils:
SimpleDateFormat sdf = new SimpleDateFormat();
sdf.applyPattern("yyyy-mm-dd");
Date fromDateConstraint = sdf.parse(fromDate);
and using in search query as below:
....
new CSFieldConstraint(EXPIRY_DATE.toString(),
CSOperator.GREATER_THAN, fromDateConstraint)
where EXPIRY_DATE is : TeamSite/Metadata/Expire_Date
I tried below too and passed it in search query:
long toTime = ((Date) fromDateConstraint).getTime();
value = new Long(toTime);
I can see that the time for same date the OOTB search is using and the one that I am getting after converting the same date is different.
Any pointers would be appreciated. Do let me know if anything else is needed from end.
Thanks,
Vaibhav
Find more posts tagged with
Comments
There are no comments yet