本文整理汇总了Java中org.apache.lucene.index.NoMergeScheduler类的典型用法代码示例。如果您正苦于以下问题:Java NoMergeScheduler类的具体用法?Java NoMergeScheduler怎么用?Java NoMergeScheduler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NoMergeScheduler类属于org.apache.lucene.index包,在下文中一共展示了NoMergeScheduler类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initSearcher
import org.apache.lucene.index.NoMergeScheduler; //导入依赖的package包/类
@Before
public void initSearcher() throws IOException {
dir = newDirectory();
IndexWriterConfig indexWriterConfig = newIndexWriterConfig(new WhitespaceAnalyzer());
indexWriterConfig.setMergeScheduler(NoMergeScheduler.INSTANCE);
indexWriterConfig.setMergePolicy(NoMergePolicy.INSTANCE);
w = new IndexWriter(dir, indexWriterConfig);
Document d = new Document();
d.add(new TextField(FIELD, "don't be", Field.Store.YES));
d.add(new TextField("_uid", "1", Field.Store.YES));
w.addDocument(d);
w.commit();
d = new Document();
d.add(new TextField(FIELD, "ever always forget be", Field.Store.YES));
d.add(new TextField("_uid", "2", Field.Store.YES));
w.addDocument(d);
w.commit();
d = new Document();
d.add(new TextField(FIELD, "careful careful", Field.Store.YES));
d.add(new TextField("_uid", "3", Field.Store.YES));
w.addDocument(d);
w.commit();
d = new Document();
d.add(new TextField(FIELD, "ever always careful careful don't be forget be", Field.Store.YES));
d.add(new TextField("_uid", "4", Field.Store.YES));
w.addDocument(d);
w.commit();
reader = DirectoryReader.open(w, true, true);
}
开发者ID:brwe,项目名称:es-token-plugin,代码行数:30,代码来源:AllTermsTests.java
示例2: reloadIndex
import org.apache.lucene.index.NoMergeScheduler; //导入依赖的package包/类
private void reloadIndex() {
Directory diskDir;
try {
synchronized (getLock()) {
initializedIndex = false;
if(!diskIndex) {
resetIndex();
return;
}
index = new MMapDirectory(directorySnapshot, NoLockFactory.getNoLockFactory());
IndexWriterConfig iwc = new IndexWriterConfig(org.apache.lucene.util.Version.LUCENE_36,
analyzer).setOpenMode(OpenMode.CREATE_OR_APPEND);
if (diskIndexRunning) {
iwc.setRAMBufferSizeMB(INDEX_RAM_BUFFER_SIZE)
.setMergePolicy(NoMergePolicy.NO_COMPOUND_FILES) // TESTING
.setMergeScheduler(NoMergeScheduler.INSTANCE); // TETING
}
writer = new IndexWriter(index, iwc);
initializedIndex = (writer.numDocs() > 0) ? true : false;
reader = IndexReader.open(getWriter(), true); /* true: apply all deletes (perfhit) */
searcher = new IndexSearcher(reader);
needsReset = false;
}
} catch (IOException e) {
System.out.println("Execption reloading index from disk; assuming corrupt. e = " + e);
e.printStackTrace();
resetIndex();
}
}
开发者ID:google,项目名称:sagetv,代码行数:30,代码来源:Wizard.java
示例3: testNoMergeScheduler
import org.apache.lucene.index.NoMergeScheduler; //导入依赖的package包/类
public void testNoMergeScheduler() throws Exception {
PerfRunData runData = createPerfRunData(null);
runData.getConfig().set("merge.scheduler", NoMergeScheduler.class.getName());
new CreateIndexTask(runData).doLogic();
new CloseIndexTask(runData).doLogic();
}
开发者ID:europeana,项目名称:search,代码行数:7,代码来源:CreateIndexTaskTest.java
注:本文中的org.apache.lucene.index.NoMergeScheduler类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论