From 71bd7420a7f9d539c3446bb63f600f1cd59f2a75 Mon Sep 17 00:00:00 2001 From: Matthew Davis Date: Wed, 14 Jun 2023 15:35:44 -0400 Subject: [PATCH] throw a more useful exception if the field does not exist --- .../src/main/java/io/zulia/server/index/ZuliaIndex.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zulia-server/src/main/java/io/zulia/server/index/ZuliaIndex.java b/zulia-server/src/main/java/io/zulia/server/index/ZuliaIndex.java index a4f06e4a..1e9ad584 100644 --- a/zulia-server/src/main/java/io/zulia/server/index/ZuliaIndex.java +++ b/zulia-server/src/main/java/io/zulia/server/index/ZuliaIndex.java @@ -414,6 +414,10 @@ private Query getTermInSetQuery(ZuliaQuery.Query query, String field) { IndexFieldInfo indexFieldInfo = indexConfig.getIndexFieldInfo(field); + if (indexFieldInfo == null) { + throw new RuntimeException("Field <" + field + "> is not indexed"); + } + String sortField = indexFieldInfo.getInternalSortFieldName(); if (sortField != null) {