From 382f789218d727fa54e9c6107ffb36452f43007e Mon Sep 17 00:00:00 2001 From: Markus Date: Mon, 12 Oct 2020 11:19:32 +0200 Subject: [PATCH] Use keyword analyer for taxon id searches --- dao/src/main/java/life/catalogue/es/EsNameUsage.java | 2 +- .../catalogue/es/nu/search/NameUsageSearchParameterTest.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dao/src/main/java/life/catalogue/es/EsNameUsage.java b/dao/src/main/java/life/catalogue/es/EsNameUsage.java index 4755a90fa2..508d286cab 100644 --- a/dao/src/main/java/life/catalogue/es/EsNameUsage.java +++ b/dao/src/main/java/life/catalogue/es/EsNameUsage.java @@ -50,7 +50,7 @@ public class EsNameUsage { private TaxonomicStatus status; private Set issues; private Set environments; - @Analyzers(STANDARD_ASCII) + @Analyzers(KEYWORD) private List classificationIds; private Boolean extinct; diff --git a/dao/src/test/java/life/catalogue/es/nu/search/NameUsageSearchParameterTest.java b/dao/src/test/java/life/catalogue/es/nu/search/NameUsageSearchParameterTest.java index 89e86a3342..570562c9dc 100644 --- a/dao/src/test/java/life/catalogue/es/nu/search/NameUsageSearchParameterTest.java +++ b/dao/src/test/java/life/catalogue/es/nu/search/NameUsageSearchParameterTest.java @@ -74,6 +74,11 @@ public void testTaxonId1() { List expected = Arrays.asList(nuw1, nuw2, nuw3); assertEquals(expected, search(query).getResult()); + query = new NameUsageSearchRequest(); + query.addFilter(TAXON_ID, "4"); + expected = Arrays.asList(nuw2, nuw3, nuw4); + assertEquals(expected, search(query).getResult()); + countdown(TAXON_ID); }