use of io.gravitee.rest.api.model.search.Indexable in project gravitee-management-rest-api by gravitee-io.
the class SearchEngineServiceImpl method process.
@Override
public void process(CommandSearchIndexerEntity content) {
if (ACTION_DELETE.equals(content.getAction())) {
try {
Indexable source = createInstance(content.getClazz());
source.setId(content.getId());
deleteLocally(source);
} catch (Exception ex) {
throw new TechnicalManagementException("Unable to delete document for content [ " + content.getId() + " - " + content.getClazz() + " ]", ex);
}
} else if (ACTION_INDEX.equals(content.getAction())) {
Indexable source = getSource(content.getClazz(), content.getId());
if (source != null) {
indexLocally(source);
}
}
}
Aggregations