CavalliumDBEngine/src/main/java/it/cavallium/dbengine/lucene/LazyFullDocs.java

38 lines
703 B
Java
Raw Normal View History

package it.cavallium.dbengine.lucene;
import java.io.Closeable;
import java.io.IOException;
import org.apache.lucene.search.TotalHits;
import reactor.core.publisher.Flux;
2021-10-15 00:03:41 +02:00
public class LazyFullDocs<T extends LLDoc> implements FullDocs<T> {
2021-10-15 00:03:41 +02:00
private final ResourceIterable<T> pq;
private final TotalHits totalHits;
2021-10-15 00:03:41 +02:00
public LazyFullDocs(ResourceIterable<T> pq, TotalHits totalHits) {
this.pq = pq;
this.totalHits = totalHits;
}
@Override
public Flux<T> iterate() {
return pq.iterate();
}
@Override
public Flux<T> iterate(long skips) {
return pq.iterate(skips);
}
@Override
public TotalHits totalHits() {
return totalHits;
}
@Override
public void close() {
pq.close();
}
}