@Override
protected QueryNode preProcessNode(QueryNode node) throws QueryNodeException {
if (node instanceof FuzzyQueryNode) {
FuzzyQueryNode fuzzyNode = (FuzzyQueryNode) node;
QueryConfigHandler config = getQueryConfigHandler();
FuzzyConfig fuzzyConfig = null;
if (config != null && (fuzzyConfig = config.get(ConfigurationKeys.FUZZY_CONFIG)) != null) {
fuzzyNode.setPrefixLength(fuzzyConfig.getPrefixLength());
if (fuzzyNode.getSimilarity() < 0) {
fuzzyNode.setSimilarity(fuzzyConfig.getMinSimilarity());
}
} else if (fuzzyNode.getSimilarity() < 0) {
throw new IllegalArgumentException("No FUZZY_CONFIG set in the config");
}
}