CavalliumDBEngine/src/main/java/it/cavallium/dbengine/database/LLSearchResultShard.java

52 lines
1.4 KiB
Java
Raw Normal View History

package it.cavallium.dbengine.database;
2021-08-04 01:12:39 +02:00
import it.cavallium.dbengine.client.query.current.data.TotalHitsCount;
2022-07-23 14:25:59 +02:00
import it.cavallium.dbengine.lucene.LuceneCloseable;
2022-06-14 18:05:26 +02:00
import it.cavallium.dbengine.utils.SimpleResource;
2022-07-23 14:25:59 +02:00
import java.util.List;
import java.util.Objects;
import java.util.stream.Stream;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class LLSearchResultShard {
2022-07-23 14:25:59 +02:00
private static final Logger LOG = LogManager.getLogger(LLSearchResultShard.class);
private final List<LLKeyScore> results;
2022-06-14 18:05:26 +02:00
private final TotalHitsCount totalHitsCount;
public LLSearchResultShard(List<LLKeyScore> results, TotalHitsCount totalHitsCount) {
this.results = results;
this.totalHitsCount = totalHitsCount;
2022-07-23 14:25:59 +02:00
}
public List<LLKeyScore> results() {
return results;
}
public TotalHitsCount totalHitsCount() {
return totalHitsCount;
}
@Override
public boolean equals(Object obj) {
if (obj == this)
return true;
if (obj == null || obj.getClass() != this.getClass())
return false;
var that = (LLSearchResultShard) obj;
2021-09-18 18:34:21 +02:00
return Objects.equals(this.results, that.results) && Objects.equals(this.totalHitsCount, that.totalHitsCount);
}
@Override
public int hashCode() {
2021-09-18 18:34:21 +02:00
return Objects.hash(results, totalHitsCount);
}
@Override
public String toString() {
2021-09-18 18:34:21 +02:00
return "LLSearchResultShard[" + "results=" + results + ", " + "totalHitsCount=" + totalHitsCount + ']';
}
}