package br.gov.servicos.cms;

import org.elasticsearch.index.query.TermFilterBuilder;
import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

import java.util.List;

public interface ConteudoRepository extends ElasticsearchRepository<Conteudo, String> {

    default List<Conteudo> findByTipo(String tipoConteudo) {
        return search(new NativeSearchQueryBuilder()
                .withFilter(new TermFilterBuilder("tipoConteudo", tipoConteudo))
                .build())
                .getContent();
    }
}
@@ -27,147 +27,8 @@
 s;%0A%0A
-import org.elasticsearch.index.query.TermFilterBuilder;%0Aimport org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;%0A
 impo
@@ -110,32 +110,8 @@
 y;%0A%0A
-import java.util.List;%0A%0A
 publ
@@ -197,265 +197,6 @@
 g%3E %7B
-%0A%0A    default List%3CConteudo%3E findByTipo(String tipoConteudo) %7B%0A        return search(new NativeSearchQueryBuilder()%0A                .withFilter(new TermFilterBuilder(%22tipoConteudo%22, tipoConteudo))%0A                .build())%0A                .getContent();%0A    %7D
 %0A%7D

Remove código morto