Commit 79647965 authored by Maxym Borodenko's avatar Maxym Borodenko

Filter on taxonomy

parent b30650b7
......@@ -80,9 +80,7 @@ public class TaxonomyFilter extends AuditedVersionedModelFilter<TaxonomyFilter,
if (CollectionUtils.isNotEmpty(genus) && taxonomyRepository != null) {
// We need to look up the taxonomy2.id for provided names so that ES queries also work out of the box
List<Long> taxGenus = taxonomyRepository.findTaxGenusId(new ArrayList<>(genus));
if (CollectionUtils.isNotEmpty(taxGenus)) {
and.and(taxonomy.taxGenus.in(taxGenus));
}
and.and(taxonomy.taxGenus.in(taxGenus));
}
if (species != null && !species.isEmpty()) {
and.and(taxonomy.species.in(species));
......@@ -98,9 +96,7 @@ public class TaxonomyFilter extends AuditedVersionedModelFilter<TaxonomyFilter,
if (CollectionUtils.isNotEmpty(genusSpecies) && taxonomyRepository != null) {
// We need to look up the taxonomy2.id for provided names so that ES queries also work out of the box
List<Long> taxSpecies = taxonomyRepository.findTaxSpeciesId(new ArrayList<>(genusSpecies));
if (CollectionUtils.isNotEmpty(taxSpecies)) {
and.and(taxonomy.taxSpecies.in(taxSpecies));
}
and.and(taxonomy.taxSpecies.in(taxSpecies));
}
return and;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment