use of org.olat.modules.qpool.manager.QuestionItemDocumentFactory in project openolat by klemens.
the class QuestionItemIndexer method deleteDocument.
@Override
public void deleteDocument(Long key, LifeFullIndexer indexWriter) {
QuestionItemDocumentFactory docFactory = CoreSpringFactory.getImpl(QuestionItemDocumentFactory.class);
String resourceUrl = docFactory.getResourceUrl(key);
indexWriter.deleteDocument(resourceUrl);
}
use of org.olat.modules.qpool.manager.QuestionItemDocumentFactory in project OpenOLAT by OpenOLAT.
the class QuestionItemIndexer method deleteDocument.
@Override
public void deleteDocument(Long key, LifeFullIndexer indexWriter) {
QuestionItemDocumentFactory docFactory = CoreSpringFactory.getImpl(QuestionItemDocumentFactory.class);
String resourceUrl = docFactory.getResourceUrl(key);
indexWriter.deleteDocument(resourceUrl);
}
use of org.olat.modules.qpool.manager.QuestionItemDocumentFactory in project OpenOLAT by OpenOLAT.
the class QuestionItemIndexer method fullIndex.
@Override
public void fullIndex(LifeFullIndexer indexWriter) {
QPoolService qpoolService = CoreSpringFactory.getImpl(QPoolService.class);
QuestionItemDocumentFactory docFactory = CoreSpringFactory.getImpl(QuestionItemDocumentFactory.class);
SearchResourceContext ctxt = new SearchResourceContext();
IndexWriter writer = null;
try {
writer = indexWriter.getAndLockWriter();
int counter = 0;
List<QuestionItemFull> items;
do {
items = qpoolService.getAllItems(counter, BATCH_SIZE);
for (QuestionItemFull item : items) {
Document doc = docFactory.createDocument(ctxt, item);
indexWriter.addDocument(doc, writer);
}
counter += items.size();
} while (items.size() == BATCH_SIZE);
} catch (Exception e) {
log.error("", e);
} finally {
indexWriter.releaseWriter(writer);
}
}
use of org.olat.modules.qpool.manager.QuestionItemDocumentFactory in project OpenOLAT by OpenOLAT.
the class QuestionItemIndexer method indexDocument.
@Override
public void indexDocument(List<Long> keyList, LifeFullIndexer indexWriter) {
QuestionItemDocumentFactory docFactory = CoreSpringFactory.getImpl(QuestionItemDocumentFactory.class);
List<Document> docs = new ArrayList<>(keyList.size());
for (Long key : keyList) {
SearchResourceContext ctxt = new SearchResourceContext();
Document doc = docFactory.createDocument(ctxt, key);
docs.add(doc);
}
indexWriter.addDocuments(docs);
}
use of org.olat.modules.qpool.manager.QuestionItemDocumentFactory in project openolat by klemens.
the class QuestionItemIndexer method indexDocument.
@Override
public void indexDocument(List<Long> keyList, LifeFullIndexer indexWriter) {
QuestionItemDocumentFactory docFactory = CoreSpringFactory.getImpl(QuestionItemDocumentFactory.class);
List<Document> docs = new ArrayList<>(keyList.size());
for (Long key : keyList) {
SearchResourceContext ctxt = new SearchResourceContext();
Document doc = docFactory.createDocument(ctxt, key);
docs.add(doc);
}
indexWriter.addDocuments(docs);
}
Aggregations