Search in sources :

Example 1 with StatustallBuckets

use of no.nav.pto.veilarbportefolje.opensearch.domene.StatustallResponse.StatustallAggregation.StatustallFilter.StatustallBuckets in project veilarbportefolje by navikt.

the class OpensearchService method hentStatusTallForEnhet.

public StatusTall hentStatusTallForEnhet(String enhetId) {
    List<String> veilederPaaEnhet = veilarbVeilederClient.hentVeilederePaaEnhet(EnhetId.of(enhetId));
    boolean vedtakstottePilotErPa = this.erVedtakstottePilotPa(EnhetId.of(enhetId));
    SearchSourceBuilder request = byggStatusTallForEnhetQuery(enhetId, veilederPaaEnhet, vedtakstottePilotErPa);
    StatustallResponse response = search(request, indexName.getValue(), StatustallResponse.class);
    StatustallBuckets buckets = response.getAggregations().getFilters().getBuckets();
    return new StatusTall(buckets, vedtakstottePilotErPa);
}
Also used : StatustallResponse(no.nav.pto.veilarbportefolje.opensearch.domene.StatustallResponse) StatusTall(no.nav.pto.veilarbportefolje.domene.StatusTall) StatustallBuckets(no.nav.pto.veilarbportefolje.opensearch.domene.StatustallResponse.StatustallAggregation.StatustallFilter.StatustallBuckets) SearchSourceBuilder(org.opensearch.search.builder.SearchSourceBuilder)

Example 2 with StatustallBuckets

use of no.nav.pto.veilarbportefolje.opensearch.domene.StatustallResponse.StatustallAggregation.StatustallFilter.StatustallBuckets in project veilarbportefolje by navikt.

the class OpensearchService method hentStatusTallForVeileder.

public StatusTall hentStatusTallForVeileder(String veilederId, String enhetId) {
    boolean vedtakstottePilotErPa = this.erVedtakstottePilotPa(EnhetId.of(enhetId));
    SearchSourceBuilder request = byggStatusTallForVeilederQuery(enhetId, veilederId, emptyList(), vedtakstottePilotErPa);
    StatustallResponse response = search(request, indexName.getValue(), StatustallResponse.class);
    StatustallBuckets buckets = response.getAggregations().getFilters().getBuckets();
    return new StatusTall(buckets, vedtakstottePilotErPa);
}
Also used : StatustallResponse(no.nav.pto.veilarbportefolje.opensearch.domene.StatustallResponse) StatusTall(no.nav.pto.veilarbportefolje.domene.StatusTall) StatustallBuckets(no.nav.pto.veilarbportefolje.opensearch.domene.StatustallResponse.StatustallAggregation.StatustallFilter.StatustallBuckets) SearchSourceBuilder(org.opensearch.search.builder.SearchSourceBuilder)

Aggregations

StatusTall (no.nav.pto.veilarbportefolje.domene.StatusTall)2 StatustallResponse (no.nav.pto.veilarbportefolje.opensearch.domene.StatustallResponse)2 StatustallBuckets (no.nav.pto.veilarbportefolje.opensearch.domene.StatustallResponse.StatustallAggregation.StatustallFilter.StatustallBuckets)2 SearchSourceBuilder (org.opensearch.search.builder.SearchSourceBuilder)2