use of org.olat.search.SearchService in project OpenOLAT by OpenOLAT.
the class SearchIndexingJob method interrupt.
@Override
public void interrupt() throws UnableToInterruptJobException {
log.info("Interrupt indexer via quartz.");
SearchService searchService = SearchServiceFactory.getService();
if (searchService instanceof SearchServiceImpl) {
((SearchServiceImpl) searchService).getInternalIndexer().stopFullIndex();
}
}
use of org.olat.search.SearchService in project OpenOLAT by OpenOLAT.
the class FileDocumentFactory method getDocumentFromCurrentIndex.
private Document getDocumentFromCurrentIndex(SearchResourceContext leafResourceContext, VFSLeaf leaf) {
try {
String resourceUrl = leafResourceContext.getResourceUrl();
SearchService searchService = CoreSpringFactory.getImpl(SearchServiceImpl.class);
Document indexedDoc = searchService.doSearch(resourceUrl);
if (indexedDoc != null) {
String timestamp = indexedDoc.get(AbstractOlatDocument.TIME_STAMP_NAME);
if (timestamp != null) {
Date indexLastModification = DateTools.stringToDate(timestamp);
Date docLastModificationDate = new Date(leaf.getLastModified());
if (leaf instanceof MetaTagged) {
MetaInfo metaInfo = ((MetaTagged) leaf).getMetaInfo();
Date metaDate = metaInfo.getMetaLastModified();
if (metaDate != null && metaDate.after(docLastModificationDate)) {
docLastModificationDate = metaDate;
}
}
if (docLastModificationDate.compareTo(indexLastModification) < 0) {
OlatDocument olatDoc = new OlatDocument(indexedDoc);
return olatDoc.getLuceneDocument();
}
}
}
} catch (ServiceNotAvailableException | ParseException | QueryException | java.text.ParseException e) {
log.error("", e);
}
return null;
}
use of org.olat.search.SearchService in project OpenOLAT by OpenOLAT.
the class SearchIndexingJob method executeWithDB.
/**
* @see org.olat.core.commons.services.scheduler.JobWithDB#executeWithDB(org.quartz.JobExecutionContext)
*/
@Override
public void executeWithDB(JobExecutionContext arg0) throws JobExecutionException {
log.info("Search indexer started via cronjob.");
SearchService searchService = SearchServiceFactory.getService();
if (searchService instanceof SearchServiceImpl) {
((SearchServiceImpl) searchService).getInternalIndexer().startFullIndex();
}
}
use of org.olat.search.SearchService in project openolat by klemens.
the class SearchIndexingJob method executeWithDB.
/**
* @see org.olat.core.commons.services.scheduler.JobWithDB#executeWithDB(org.quartz.JobExecutionContext)
*/
@Override
public void executeWithDB(JobExecutionContext arg0) throws JobExecutionException {
log.info("Search indexer started via cronjob.");
SearchService searchService = SearchServiceFactory.getService();
if (searchService instanceof SearchServiceImpl) {
((SearchServiceImpl) searchService).getInternalIndexer().startFullIndex();
}
}
use of org.olat.search.SearchService in project openolat by klemens.
the class SearchIndexingJob method interrupt.
@Override
public void interrupt() throws UnableToInterruptJobException {
log.info("Interrupt indexer via quartz.");
SearchService searchService = SearchServiceFactory.getService();
if (searchService instanceof SearchServiceImpl) {
((SearchServiceImpl) searchService).getInternalIndexer().stopFullIndex();
}
}
Aggregations