Java 类org.apache.lucene.util.WAH8DocIdSet 实例源码

项目:search    文件:TestCachingWrapperFilter.java   
private static void assertDocIdSetCacheable(IndexReader reader, Filter filter, boolean shouldCacheable) throws IOException {
  assertTrue(reader.getContext() instanceof AtomicReaderContext);
  AtomicReaderContext context = (AtomicReaderContext) reader.getContext();
  final CachingWrapperFilter cacher = new CachingWrapperFilter(filter);
  final DocIdSet originalSet = filter.getDocIdSet(context, context.reader().getLiveDocs());
  final DocIdSet cachedSet = cacher.getDocIdSet(context, context.reader().getLiveDocs());
  if (originalSet == null) {
    assertNull(cachedSet);
  }
  if (cachedSet == null) {
    assertTrue(originalSet == null || originalSet.iterator() == null);
  } else {
    assertTrue(cachedSet.isCacheable());
    assertEquals(shouldCacheable, originalSet.isCacheable());
    //System.out.println("Original: "+originalSet.getClass().getName()+" -- cached: "+cachedSet.getClass().getName());
    if (originalSet.isCacheable()) {
      assertEquals("Cached DocIdSet must be of same class like uncached, if cacheable", originalSet.getClass(), cachedSet.getClass());
    } else {
      assertTrue("Cached DocIdSet must be an WAH8DocIdSet if the original one was not cacheable", cachedSet instanceof WAH8DocIdSet || cachedSet == null);
    }
  }
}
项目:lams    文件:CachingWrapperFilter.java   
/**
 * Default cache implementation: uses {@link WAH8DocIdSet}.
 */
protected DocIdSet cacheImpl(DocIdSetIterator iterator, AtomicReader reader) throws IOException {
  WAH8DocIdSet.Builder builder = new WAH8DocIdSet.Builder();
  builder.add(iterator);
  return builder.build();
}
项目:search    文件:CachingWrapperFilter.java   
/**
 * Default cache implementation: uses {@link WAH8DocIdSet}.
 */
protected DocIdSet cacheImpl(DocIdSetIterator iterator, AtomicReader reader) throws IOException {
  WAH8DocIdSet.Builder builder = new WAH8DocIdSet.Builder();
  builder.add(iterator);
  return builder.build();
}
项目:read-open-source-code    文件:CachingWrapperFilter.java   
/**
 * Default cache implementation: uses {@link WAH8DocIdSet}.
 */
protected DocIdSet cacheImpl(DocIdSetIterator iterator, AtomicReader reader) throws IOException {
  WAH8DocIdSet.Builder builder = new WAH8DocIdSet.Builder();
  builder.add(iterator);
  return builder.build();
}
项目:read-open-source-code    文件:CachingWrapperFilter.java   
/**
 * Default cache implementation: uses {@link WAH8DocIdSet}.
 */
protected DocIdSet cacheImpl(DocIdSetIterator iterator, AtomicReader reader) throws IOException {
  WAH8DocIdSet.Builder builder = new WAH8DocIdSet.Builder();
  builder.add(iterator);
  return builder.build();
}
项目:read-open-source-code    文件:CachingWrapperFilter.java   
/**
 * Default cache implementation: uses {@link WAH8DocIdSet}.
 */
protected DocIdSet cacheImpl(DocIdSetIterator iterator, AtomicReader reader) throws IOException {
  WAH8DocIdSet.Builder builder = new WAH8DocIdSet.Builder();
  builder.add(iterator);
  return builder.build();
}
项目:Maskana-Gestor-de-Conocimiento    文件:CachingWrapperFilter.java   
/**
 * Default cache implementation: uses {@link WAH8DocIdSet}.
 */
protected DocIdSet cacheImpl(DocIdSetIterator iterator, AtomicReader reader) throws IOException {
  WAH8DocIdSet.Builder builder = new WAH8DocIdSet.Builder();
  builder.add(iterator);
  return builder.build();
}