List of usage examples for org.apache.lucene.queryparser.flexible.core.config QueryConfigHandler has
public <T> boolean has(ConfigurationKey<T> key)
From source file:com.sindicetech.siren.qparser.keyword.processors.ChangeDefaultOperatorNodeProcessor.java
License:Open Source License
@Override protected QueryNode postProcessNode(final QueryNode node) throws QueryNodeException { if (node.getParent() == null) { // node is root, we processed the tree if (hasUnaryReqOperator) { // we found a req modifier in the tree final QueryConfigHandler conf = this.getQueryConfigHandler(); if (!conf.has(ConfigurationKeys.DEFAULT_OPERATOR)) { throw new IllegalArgumentException( "ConfigurationKeys.DEFAULT_OPERATOR should be set on the QueryConfigHandler"); }//from www . j a v a 2 s .c o m conf.set(ConfigurationKeys.DEFAULT_OPERATOR, Operator.OR); } } return node; }
From source file:com.sindicetech.siren.qparser.keyword.processors.DatatypeProcessor.java
License:Open Source License
public static String getDefaultDatatype(QueryConfigHandler config) { if (config.has(KeywordConfigurationKeys.DEFAULT_DATATYPE)) { return config.get(KeywordConfigurationKeys.DEFAULT_DATATYPE); } else {/*from w w w. j ava 2 s .c om*/ throw new IllegalArgumentException( "KeywordConfigurationKeys.DEFAULT_DATATYPE should be set on the ExtendedKeywordQueryConfigHandler"); } }