Hi
I am planning to call a scheduled saved search from java
SavedSearch savedSearch = service.getSavedSearches().get("mysavedsearch");
Job[] jobColl=null;
jobColl =savedSearch.history();
How can I get the last run job results from here.
Thanks
If the jobColl is not empty, then the first element in the array will be the most recent run.
SavedSearch savedSearch = service.getSavedSearches().get("mysavedsearch");
Job[] jobColl =savedSearch.history();
Job job;
if (jobColl.length > 0) {
// get the most recent run
job = jobColl[0];
} else {
job = savedSearch.dispatch();
}
i m not getting the results... because the search has stats count in the search. how to fix it
Yes.Thanks for clarification
job.cancel() will remove that particular job from the saved search's history ... if that's what you are asking.
Thanks.
Am using job.cancel(), after this operation.Does this remove the scheduled saved search from the history?