Search in sources :

Example 1 with EntityNameCleaner

use of io.openk9.entity.manager.cleaner.EntityNameCleaner in project openk9 by smclab.

the class CreateEntitiesRunnable method getEntityCandidates.

private EntityCandidates getEntityCandidates(EntityNameCleanerProvider entityNameCleanerProvider, EntityService entityService, EntityMember ingestionIdEntityMember, Entity ingestionIdEntity) {
    EntityNameCleaner entityNameCleaner = entityNameCleanerProvider.get(ingestionIdEntity.getType());
    QueryBuilder queryBuilder = entityNameCleaner.cleanEntityName(ingestionIdEntity.getTenantId(), ingestionIdEntity.getName());
    List<EntityIndex> candidates = entityService.search(ingestionIdEntity.getTenantId(), queryBuilder, 0, 10);
    return EntityCandidates.of(ingestionIdEntityMember, candidates);
}
Also used : EntityIndex(io.openk9.entity.manager.model.index.EntityIndex) QueryBuilder(org.elasticsearch.index.query.QueryBuilder) EntityNameCleaner(io.openk9.entity.manager.cleaner.EntityNameCleaner)

Aggregations

EntityNameCleaner (io.openk9.entity.manager.cleaner.EntityNameCleaner)1 EntityIndex (io.openk9.entity.manager.model.index.EntityIndex)1 QueryBuilder (org.elasticsearch.index.query.QueryBuilder)1