aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src
diff options
context:
space:
mode:
Diffstat (limited to 'container-search/src')
-rw-r--r--container-search/src/main/java/com/yahoo/search/grouping/GroupingValidator.java5
-rw-r--r--container-search/src/main/java/com/yahoo/search/searchers/QueryValidator.java5
2 files changed, 4 insertions, 6 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/grouping/GroupingValidator.java b/container-search/src/main/java/com/yahoo/search/grouping/GroupingValidator.java
index d61da0ebedf..d4e295fb51f 100644
--- a/container-search/src/main/java/com/yahoo/search/grouping/GroupingValidator.java
+++ b/container-search/src/main/java/com/yahoo/search/grouping/GroupingValidator.java
@@ -55,7 +55,7 @@ public class GroupingValidator extends Searcher {
var searchCluster = qrsConfig.searchcluster(clusterId);
QrSearchersConfig.Searchcluster.Indexingmode.Enum indexingMode = searchCluster.indexingmode();
enabled = (indexingMode != QrSearchersConfig.Searchcluster.Indexingmode.STREAMING);
- clusterName = enabled ? searchCluster.name() : null;
+ clusterName = searchCluster.name();
for (AttributesConfig.Attribute attr : attributesConfig.attribute()) {
attributes.put(attr.name(), attr);
}
@@ -97,8 +97,7 @@ public class GroupingValidator extends Searcher {
@Override
public void visitExpression(GroupingExpression exp) {
- if (exp instanceof AttributeMapLookupValue) {
- AttributeMapLookupValue mapLookup = (AttributeMapLookupValue) exp;
+ if (exp instanceof AttributeMapLookupValue mapLookup) {
verifyHasAttribute(mapLookup.getKeyAttribute());
verifyHasAttribute(mapLookup.getValueAttribute());
if (mapLookup.hasKeySourceAttribute()) {
diff --git a/container-search/src/main/java/com/yahoo/search/searchers/QueryValidator.java b/container-search/src/main/java/com/yahoo/search/searchers/QueryValidator.java
index 033e567d53a..1c95a07cdfd 100644
--- a/container-search/src/main/java/com/yahoo/search/searchers/QueryValidator.java
+++ b/container-search/src/main/java/com/yahoo/search/searchers/QueryValidator.java
@@ -11,7 +11,6 @@ import com.yahoo.search.Query;
import com.yahoo.search.Result;
import com.yahoo.search.Searcher;
import com.yahoo.search.schema.Field;
-import com.yahoo.search.schema.FieldInfo;
import com.yahoo.search.schema.SchemaInfo;
import com.yahoo.search.searchchain.Execution;
import com.yahoo.search.searchchain.PhaseNames;
@@ -55,7 +54,7 @@ public class QueryValidator extends Searcher {
public boolean visit(Item item) {
if (item instanceof HasIndexItem indexItem) {
var field = schema.fieldInfo(indexItem.getIndexName());
- if (! field.isPresent()) return true;
+ if (field.isEmpty()) return true;
if (field.get().type().kind() == Field.Type.Kind.TENSOR)
throw new IllegalArgumentException("Cannot search for terms in '" + indexItem.getIndexName() +
"': It is a tensor field");
@@ -76,7 +75,7 @@ public class QueryValidator extends Searcher {
if (schema.isStreaming()) return true; // prefix is always supported
if (item instanceof PrefixItem prefixItem) {
var field = schema.fieldInfo(prefixItem.getIndexName());
- if (! field.isPresent()) return true;
+ if (field.isEmpty()) return true;
if ( ! field.get().isAttribute())
throw new IllegalArgumentException("'" + prefixItem.getIndexName() + "' is not an attribute field: Prefix matching is not supported");
if (field.get().isIndex()) // index overrides attribute