Package org.apache.lucene.queryParser.core.config

Examples of org.apache.lucene.queryParser.core.config.QueryConfigHandler


  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.hasAttribute(UniqueFieldAttribute.class)) {
        throw new IllegalArgumentException(
            "UniqueFieldAttribute should be defined in the config handler!");
      }

      CharSequence uniqueField = ((UniqueFieldAttribute) queryConfig
          .getAttribute(UniqueFieldAttribute.class)).getUniqueField();

      fieldNode.setField(uniqueField);

    }
View Full Code Here


    AnalyzerAttribute attr= (AnalyzerAttribute) getQueryConfigHandler().getAttribute(AnalyzerAttribute.class);
    attr.setAnalyzer(analyzer);
  }
 
  public Analyzer getAnalyzer() {   
    QueryConfigHandler config = this.getQueryConfigHandler();

    if ( config.hasAttribute(AnalyzerAttribute.class)) {
      AnalyzerAttribute attr= (AnalyzerAttribute) config.getAttribute(AnalyzerAttribute.class);
      return attr.getAnalyzer();
    }

    return null;      
  }
View Full Code Here

TOP

Related Classes of org.apache.lucene.queryParser.core.config.QueryConfigHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.