Search in sources :

Example 1 with Bucket

use of no.nav.pto.veilarbportefolje.opensearch.domene.Bucket in project veilarbportefolje by navikt.

the class OpensearchService method hentPortefoljestorrelser.

public FacetResults hentPortefoljestorrelser(String enhetId) {
    SearchSourceBuilder request = byggPortefoljestorrelserQuery(enhetId);
    PortefoljestorrelserResponse response = search(request, indexName.getValue(), PortefoljestorrelserResponse.class);
    List<Bucket> buckets = response.getAggregations().getFilter().getSterms().getBuckets();
    return new FacetResults(buckets);
}
Also used : FacetResults(no.nav.pto.veilarbportefolje.domene.FacetResults) Bucket(no.nav.pto.veilarbportefolje.opensearch.domene.Bucket) PortefoljestorrelserResponse(no.nav.pto.veilarbportefolje.opensearch.domene.PortefoljestorrelserResponse) SearchSourceBuilder(org.opensearch.search.builder.SearchSourceBuilder)

Aggregations

FacetResults (no.nav.pto.veilarbportefolje.domene.FacetResults)1 Bucket (no.nav.pto.veilarbportefolje.opensearch.domene.Bucket)1 PortefoljestorrelserResponse (no.nav.pto.veilarbportefolje.opensearch.domene.PortefoljestorrelserResponse)1 SearchSourceBuilder (org.opensearch.search.builder.SearchSourceBuilder)1