2021-10-13 00:23:56 +02:00
|
|
|
package it.cavallium.dbengine.lucene;
|
|
|
|
|
|
|
|
import java.util.List;
|
2021-10-14 23:04:34 +02:00
|
|
|
import java.util.Objects;
|
|
|
|
import java.util.stream.Collectors;
|
2021-10-15 22:03:53 +02:00
|
|
|
import org.apache.lucene.search.FieldDoc;
|
2021-10-13 00:23:56 +02:00
|
|
|
|
2021-10-15 00:03:41 +02:00
|
|
|
public record LLFieldDoc(int doc, float score, int shardIndex, List<Object> fields) implements LLDoc {
|
2021-10-14 23:04:34 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return "doc=" + doc + " score=" + score + " shardIndex=" + shardIndex + " fields="+ fields.stream()
|
|
|
|
.map(Objects::toString).collect(Collectors.joining(",", "[", "]"));
|
|
|
|
}
|
2021-10-15 22:03:53 +02:00
|
|
|
|
|
|
|
public FieldDoc toFieldDoc() {
|
|
|
|
return new FieldDoc(doc, score, fields.toArray(Object[]::new), shardIndex);
|
|
|
|
}
|
2021-10-14 23:04:34 +02:00
|
|
|
}
|