gpt4 book ai didi

org.hibernate.search.backend.impl.lucene.WorkspaceHolder.getIndexResources()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-24 18:11:05 26 4
gpt4 key购买 nike

本文整理了Java中org.hibernate.search.backend.impl.lucene.WorkspaceHolder.getIndexResources()方法的一些代码示例,展示了WorkspaceHolder.getIndexResources()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorkspaceHolder.getIndexResources()方法的具体详情如下:
包路径:org.hibernate.search.backend.impl.lucene.WorkspaceHolder
类名称:WorkspaceHolder
方法名:getIndexResources

WorkspaceHolder.getIndexResources介绍

暂无

代码示例

代码示例来源:origin: hibernate/hibernate-search

/**
 * This essentially kills the backend: needed to release the IndexWriter lock
 * so that the CheckIndex task can be run.
 * You'll need to ignore further issues if indexing is attempted, and even shutdown
 * might not be graceful (the shutdown is not designed to be recoverable).
 */
private static void stopBackend(DirectoryBasedIndexManager directoryBasedIndexManager) {
  WorkspaceHolder backendQueueProcessor = (WorkspaceHolder) directoryBasedIndexManager.getWorkspaceHolder();
  backendQueueProcessor.getIndexResources().shutdown();
}

代码示例来源:origin: hibernate/hibernate-search

private void assertExclusiveIsEnabled(IndexManagerHolder allIndexesManager, String indexName, boolean expectExclusive) {
  DirectoryBasedIndexManager indexManager = (DirectoryBasedIndexManager) allIndexesManager.getIndexManager( indexName );
  WorkspaceHolder workspaceHolder = indexManager.getWorkspaceHolder();
  AbstractWorkspaceImpl workspace = workspaceHolder.getIndexResources().getWorkspace();
  if ( expectExclusive ) {
    assertEquals( ExclusiveIndexWorkspaceImpl.class, workspace.getClass() );
  }
  else {
    assertEquals( SharedIndexWorkspaceImpl.class, workspace.getClass() );
  }
}

代码示例来源:origin: hibernate/hibernate-search

public AbstractWorkspaceImpl extractWorkspace(IndexedTypeIdentifier indexedType) {
  DirectoryBasedIndexManager indexManager = (DirectoryBasedIndexManager) extractIndexManager( indexedType );
  WorkspaceHolder backend = indexManager.getWorkspaceHolder();
  return backend.getIndexResources().getWorkspace();
}

代码示例来源:origin: org.infinispan/infinispan-query

private void assertEfficientIndexingUsed(SearchIntegrator searchIntegrator, Class<?> clazz) {
   DirectoryBasedIndexManager im = (DirectoryBasedIndexManager) searchIntegrator.getIndexBindings().get(clazz)
      .getIndexManagerSelector().all().iterator().next();
   WorkspaceHolder workspaceHolder = im.getWorkspaceHolder();
   LuceneBackendResources indexResources = workspaceHolder.getIndexResources();
   IndexWorkVisitor<Void, LuceneWorkExecutor> visitor = indexResources.getWorkVisitor();
   assertTrue(TestingUtil.extractField(visitor, "updateExecutor") instanceof ByTermUpdateWorkExecutor);
  }
}

代码示例来源:origin: hibernate/hibernate-search

protected static AbstractWorkspaceImpl extractWorkspace(MutableSearchFactory sf, Class<?> type) {
  EntityIndexBinding indexBindingForEntity = sf.getIndexBindings().get( type );
  DirectoryBasedIndexManager indexManager =
      (DirectoryBasedIndexManager) indexBindingForEntity.getIndexManagerSelector().all().iterator().next();
  WorkspaceHolder backend = (WorkspaceHolder) indexManager.getWorkspaceHolder();
  return backend.getIndexResources().getWorkspace();
}

代码示例来源:origin: hibernate/hibernate-search

@Test
public void testNothingTest() {
  SearchIntegrator searchFactory = getSearchFactory().unwrap( SearchIntegrator.class );
  EntityIndexBinding indexBindingForEntity = searchFactory.getIndexBindings().get( Clock.class );
  Set<IndexManager> indexManagers = indexBindingForEntity.getIndexManagerSelector().all();
  assertEquals( 1, indexManagers.size() );
  DirectoryBasedIndexManager indexManager = (DirectoryBasedIndexManager) indexManagers.iterator().next();
  WorkspaceHolder backend = (WorkspaceHolder) indexManager.getWorkspaceHolder();
  assertEquals( 5, backend.getIndexResources().getMaxQueueLength() );
}

代码示例来源:origin: hibernate/hibernate-search

IndexWriter writer = backendProcessor.getIndexResources().getWorkspace().getIndexWriter();
Document document = new Document();
document.add( new StringField( "id", "1", org.apache.lucene.document.Field.Store.NO ) );

代码示例来源:origin: hibernate/hibernate-search

IndexWriter writer = backendProcessor.getIndexResources().getWorkspace().getIndexWriter();
Document document = new Document();
document.add( new StringField( "id", "1", org.apache.lucene.document.Field.Store.NO ) );

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com