use of org.molgenis.data.elasticsearch.generator.model.Index in project molgenis by molgenis.
the class ElasticsearchService method explain.
public Explanation explain(EntityType entityType, Object entityId, Query<Entity> q) {
Index index = contentGenerators.createIndex(entityType);
Document document = contentGenerators.createDocument(entityId);
QueryBuilder query = contentGenerators.createQuery(q, entityType);
return clientFacade.explain(SearchHit.create(document.getId(), index.getName()), query);
}
use of org.molgenis.data.elasticsearch.generator.model.Index in project molgenis by molgenis.
the class ElasticsearchService method count.
@Override
public long count(EntityType entityType, Query<Entity> q) {
Index index = contentGenerators.createIndex(entityType);
QueryBuilder queryBuilder = contentGenerators.createQuery(q, entityType);
return clientFacade.getCount(queryBuilder, index);
}
use of org.molgenis.data.elasticsearch.generator.model.Index in project molgenis by molgenis.
the class ElasticsearchService method aggregate.
@Override
public AggregateResult aggregate(final EntityType entityType, AggregateQuery aggregateQuery) {
List<AggregationBuilder> aggregationList = contentGenerators.createAggregations(aggregateQuery.getAttributeX(), aggregateQuery.getAttributeY(), aggregateQuery.getAttributeDistinct());
QueryBuilder query = contentGenerators.createQuery(aggregateQuery.getQuery(), entityType);
Index index = contentGenerators.createIndex(entityType);
Aggregations aggregations = clientFacade.aggregate(aggregationList, query, index);
return new AggregateResponseParser().parseAggregateResponse(aggregateQuery.getAttributeX(), aggregateQuery.getAttributeY(), aggregateQuery.getAttributeDistinct(), aggregations, dataService);
}
use of org.molgenis.data.elasticsearch.generator.model.Index in project molgenis by molgenis.
the class ElasticsearchService method index.
@Override
public void index(EntityType entityType, Entity entity) {
Index index = contentGenerators.createIndex(entityType);
Document document = contentGenerators.createDocument(entity);
clientFacade.index(index, document);
}
use of org.molgenis.data.elasticsearch.generator.model.Index in project molgenis by molgenis.
the class ElasticsearchService method deleteById.
@Override
public void deleteById(EntityType entityType, Object entityId) {
Index index = contentGenerators.createIndex(entityType);
Document document = contentGenerators.createDocument(entityId);
clientFacade.deleteById(index, document);
}
Aggregations