protected QueryNode preProcessNode(QueryNode node) throws QueryNodeException {
if (node instanceof FieldableNode) {
FieldableNode fieldNode = (FieldableNode) node;
QueryConfigHandler queryConfig = getQueryConfigHandler();
if (queryConfig == null) {
throw new IllegalArgumentException(
"A config handler is expected by the processor UniqueFieldQueryNodeProcessor!");
}
if (!queryConfig.has(SpansQueryConfigHandler.UNIQUE_FIELD)) {
throw new IllegalArgumentException(
"UniqueFieldAttribute should be defined in the config handler!");
}
String uniqueField = queryConfig.get(SpansQueryConfigHandler.UNIQUE_FIELD);
fieldNode.setField(uniqueField);
}
return node;