Package org.apache.lucene.index

Examples of org.apache.lucene.index.CrossVersionIndexWriter


    }//TESTED

    RAMDirectory idx = new RAMDirectory();

    try {
      CrossVersionIndexWriter writer = new CrossVersionIndexWriter(idx, Version.LUCENE_30, new StandardAnalyzer(Version.LUCENE_30));
      int nAdded = 0;
      indexToSearchCacheIndexes = new EntityFeaturePojo[aliasTable.masters().size()];
      for (EntityFeaturePojo alias: aliasTable.masters()) {

        if ((null != alias.getIndex()) && (null != alias.getDisambiguatedName()) && (null != alias.getAlias())
            && !alias.getIndex().equalsIgnoreCase("discard") && !alias.getAlias().contains(alias.getIndex()))
        {
          // (that last check just means there's no point in including the alias if it has itself as a sub-alias)
          writer.addSingleAnalyzedUnstoredFieldDocument("name", alias.getDisambiguatedName());
          indexToSearchCacheIndexes[nAdded] = alias;
          nAdded++;
          //System.out.println("CACHE ADD: " + alias.getDisambiguatedName() + ": " + nAdded + " - " + alias.getIndex());
        }
      }
      writer.close();
     
      if (nAdded > 0) {
        if (null != _aliasSearcherCache) {
          try {
            _aliasSearcherCache.getIndexReader().close();
View Full Code Here

TOP

Related Classes of org.apache.lucene.index.CrossVersionIndexWriter

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.