From b6d3e602163e0b28fe66d2807b187b157f2d0e06 Mon Sep 17 00:00:00 2001 From: Patrick Austin Date: Fri, 6 Oct 2023 14:27:30 +0000 Subject: [PATCH] Add special handling for InvestigationInstrument filters #18 --- src/main/java/org/icatproject/lucene/SearchBucket.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/org/icatproject/lucene/SearchBucket.java b/src/main/java/org/icatproject/lucene/SearchBucket.java index aca88fa..31d12a3 100644 --- a/src/main/java/org/icatproject/lucene/SearchBucket.java +++ b/src/main/java/org/icatproject/lucene/SearchBucket.java @@ -320,6 +320,9 @@ private void buildFilterQueries(String target, JsonObject requestedQuery, Builde if (filterTarget.equals("sample") && !target.equals("investigation")) { nestedQuery = JoinUtil.createJoinQuery("sample.id", false, "sample.id", Long.class, dimensionQuery, nestedSearcher, ScoreMode.None); + } else if (filterTarget.toLowerCase().equals("investigationinstrument") && !target.equals("investigation")) { + nestedQuery = JoinUtil.createJoinQuery("investigation.id", false, "investigation.id", Long.class, dimensionQuery, + nestedSearcher, ScoreMode.None); } else { nestedQuery = JoinUtil.createJoinQuery(target + ".id", false, "id", Long.class, dimensionQuery, nestedSearcher, ScoreMode.None);