use of datawave.query.language.functions.jexl.EvaluationOnly in project datawave by NationalSecurityAgency.
the class LuceneQueryTest method testInit.
// ============================================
// implemented abstract methods
protected void testInit() {
this.auths = CitiesDataType.getTestAuths();
this.documentKey = CityField.EVENT_ID.name();
LuceneToJexlQueryParser parser = new LuceneToJexlQueryParser();
for (JexlQueryFunction queryFunction : parser.getAllowedFunctions()) {
if (queryFunction instanceof EvaluationOnly) {
((EvaluationOnly) queryFunction).setParser(parser);
break;
}
}
this.logic.setParser(parser);
}
use of datawave.query.language.functions.jexl.EvaluationOnly in project datawave-query-metric-service by NationalSecurityAgency.
the class QueryMetricHandlerConfiguration method luceneToJexlQueryParser.
@Bean
@ConditionalOnMissingBean
public LuceneToJexlQueryParser luceneToJexlQueryParser() {
LuceneToJexlQueryParser luceneToJexlQueryParser = new LuceneToJexlQueryParser();
Set<String> skipTokenizedUnfieldedFields = new LinkedHashSet<>();
skipTokenizedUnfieldedFields.add("DOMETA");
luceneToJexlQueryParser.setSkipTokenizeUnfieldedFields(skipTokenizedUnfieldedFields);
Map<String, JexlQueryFunction> allowedFunctions = new LinkedHashMap<>();
for (JexlQueryFunction f : JexlTreeBuilder.DEFAULT_ALLOWED_FUNCTION_LIST) {
allowedFunctions.put(f.getClass().getCanonicalName(), f);
}
// configure EvaluationOnly with this parser
EvaluationOnly evaluationOnly = new EvaluationOnly();
evaluationOnly.setParser(luceneToJexlQueryParser);
allowedFunctions.put(EvaluationOnly.class.getCanonicalName(), evaluationOnly);
luceneToJexlQueryParser.setAllowedFunctions(new ArrayList<>(allowedFunctions.values()));
return luceneToJexlQueryParser;
}
Aggregations