Package com.esri.gpt.catalog.lucene

Examples of com.esri.gpt.catalog.lucene.ParserAdaptorInfos


    cfg.getLuceneConfig().setUseConstantScoreQuery(
        Val.chkBool(xpath.evaluate("@useConstantScoreQuery", ndLucene), false));
    cfg.getLuceneConfig().setMaxClauseCount(
        Val.chkInt(xpath.evaluate("@maxClauseCount", ndLucene), BooleanQuery.getMaxClauseCount()));

    ParserAdaptorInfos infos = new ParserAdaptorInfos();
    NodeList ndLstProxies = (NodeList) xpath.evaluate("adaptor", ndLucene,
        XPathConstants.NODESET);
    for (int i = 0; i < ndLstProxies.getLength(); i++) {
      Node ndProxy = ndLstProxies.item(i);
      String proxyName = xpath.evaluate("@name", ndProxy);
      String proxyClassName = xpath.evaluate("@className", ndProxy);

      ParserAdaptorInfo info = new ParserAdaptorInfo();
      info.setName(proxyName);
      info.setClassName(proxyClassName);

      NodeList ndListProps = (NodeList) xpath.evaluate("attribute", ndProxy,
          XPathConstants.NODESET);
      for (int p = 0; p < ndListProps.getLength(); p++) {
        Node ndProp = ndListProps.item(p);
        String key = xpath.evaluate("@key", ndProp);
        String value = xpath.evaluate("@value", ndProp);
        info.getAttributes().set(key, value);
      }

      infos.add(info);
    }

    cfg.getLuceneConfig().setParserProxies(infos.createParserProxies());
   
    NodeList ndObservers = (NodeList) xpath.evaluate("observer", ndLucene, XPathConstants.NODESET);
    for (Node ndObserver: new NodeListAdapter(ndObservers)) {
      LuceneIndexObserverInfo info = new LuceneIndexObserverInfo();
      info.setClassName(Val.chkStr(xpath.evaluate("@className", ndObserver)));
View Full Code Here

TOP

Related Classes of com.esri.gpt.catalog.lucene.ParserAdaptorInfos

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.