Package railo.runtime.search

Examples of railo.runtime.search.SearchEngine


   * @throws PageException
  **/
  public void setCollection(String collection) throws PageException  {
    String[] collNames=ListUtil.toStringArrayTrim(ListUtil.listToArrayRemoveEmpty(collection,','));
      collections=new SearchCollection[collNames.length];
      SearchEngine se = pageContext.getConfig().getSearchEngine();
      try {
        for(int i=0;i<collections.length;i++) {
            collections[i]=se.getCollectionByName(collNames[i]);
        }
      } catch (SearchException e) {
          collections=null;
          throw Caster.toPageException(e);
      }
View Full Code Here


    Resource configDir = config.getConfigDir();

    Element search = getChildByName(doc.getDocumentElement(), "search");

    String strEngineClass = search.getAttribute("engine-class");
    SearchEngine se = null;
    Object o = ClassUtil.loadInstance(strEngineClass, (Object) null);
    if (o instanceof SearchEngine)
      se = (SearchEngine) o;

    if (se == null)
      se = new railo.runtime.search.lucene2.LuceneSearchEngine();

    try {
      // Logger
      String strLogger = search.getAttribute("log");
      int logLevel = LogUtil.toIntType(search.getAttribute("log-level"), Log.LEVEL_ERROR);
      LogAndSource log = ConfigWebUtil.getLogAndSource(configServer, config, strLogger, true, logLevel);

      // Init
      se.init(config, ConfigWebUtil.getFile(configDir, ConfigWebUtil.translateOldPath(search.getAttribute("directory")), "search", configDir, FileUtil.TYPE_DIR, config), log);
    }
    catch (Exception e) {
      throw Caster.toPageException(e);
    }
View Full Code Here

TOP

Related Classes of railo.runtime.search.SearchEngine

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.