Example usage for org.apache.lucene.queryparser.flexible.core.config QueryConfigHandler set

List of usage examples for org.apache.lucene.queryparser.flexible.core.config QueryConfigHandler set

Introduction

In this page you can find the example usage for org.apache.lucene.queryparser.flexible.core.config QueryConfigHandler set.

Prototype

public <T> void set(ConfigurationKey<T> key, T value) 

Source Link

Document

Sets a key and its value.

Usage

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");
            }//  w  w w  . j  a  v  a  2 s.  co  m
            conf.set(ConfigurationKeys.DEFAULT_OPERATOR, Operator.OR);
        }
    }
    return node;

}