use of io.vertigo.dynamo.search.model.SearchIndex in project vertigo by KleeGroup.
the class ItemSearchLoader method loadData.
/**
* {@inheritDoc}
*/
@Override
public List<SearchIndex<Item, Item>> loadData(final SearchChunk<Item> searchChunk) {
final SearchIndexDefinition indexDefinition = searchManager.findFirstIndexDefinitionByKeyConcept(Item.class);
try (final VTransactionWritable tx = getTransactionManager().createCurrentTransaction()) {
final List<SearchIndex<Item, Item>> result = new ArrayList<>();
final DtDefinition dtDefinition = DtObjectUtil.findDtDefinition(Item.class);
for (final Item item : loadItems(searchChunk)) {
final URI<Item> uri = new URI<>(dtDefinition, item.getId());
result.add(SearchIndex.createIndex(indexDefinition, uri, item));
}
return result;
}
}
use of io.vertigo.dynamo.search.model.SearchIndex in project vertigo by KleeGroup.
the class ReindexTask method loadAndIndex.
private void loadAndIndex(final SearchChunk<? extends KeyConcept> searchChunk) {
final SearchLoader searchLoader = Home.getApp().getComponentSpace().resolve(searchIndexDefinition.getSearchLoaderId(), SearchLoader.class);
final Collection<SearchIndex<KeyConcept, DtObject>> searchIndexes;
searchIndexes = searchLoader.loadData(searchChunk);
removedNotFoundKeyConcept(searchIndexes, searchChunk);
if (!searchIndexes.isEmpty()) {
searchManager.putAll(searchIndexDefinition, searchIndexes);
}
}
Aggregations