2021-10-13 00:23:56 +02:00
|
|
|
package it.cavallium.dbengine.lucene;
|
|
|
|
|
2021-12-18 21:01:14 +01:00
|
|
|
import java.io.Closeable;
|
|
|
|
import java.io.IOException;
|
2021-10-13 00:23:56 +02:00
|
|
|
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-13 00:23:56 +02:00
|
|
|
|
2021-10-15 00:03:41 +02:00
|
|
|
private final ResourceIterable<T> pq;
|
2021-10-13 00:23:56 +02:00
|
|
|
private final TotalHits totalHits;
|
|
|
|
|
2021-10-15 00:03:41 +02:00
|
|
|
public LazyFullDocs(ResourceIterable<T> pq, TotalHits totalHits) {
|
2021-10-13 00:23:56 +02:00
|
|
|
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;
|
|
|
|
}
|
2021-12-18 21:01:14 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void close() {
|
|
|
|
pq.close();
|
|
|
|
}
|
2021-10-13 00:23:56 +02:00
|
|
|
}
|