mirror of https://github.com/apache/lucene.git
Add null check
This commit is contained in:
parent
8cd3ccf441
commit
30e377a361
|
@ -67,6 +67,9 @@ public class RerankKnnFloatVectorQuery extends Query {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
FieldInfo fi = leaf.reader().getFieldInfos().fieldInfo(query.getField());
|
FieldInfo fi = leaf.reader().getFieldInfos().fieldInfo(query.getField());
|
||||||
|
if (fi == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
VectorSimilarityFunction comparer = fi.getVectorSimilarityFunction();
|
VectorSimilarityFunction comparer = fi.getVectorSimilarityFunction();
|
||||||
DocIdSetIterator iterator = scorer.iterator();
|
DocIdSetIterator iterator = scorer.iterator();
|
||||||
while (iterator.nextDoc() != DocIdSetIterator.NO_MORE_DOCS) {
|
while (iterator.nextDoc() != DocIdSetIterator.NO_MORE_DOCS) {
|
||||||
|
@ -95,7 +98,7 @@ public class RerankKnnFloatVectorQuery extends Query {
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) return true;
|
if (this == o) return true;
|
||||||
RerankKnnFloatVectorQuery that = (RerankKnnFloatVectorQuery) o;
|
RerankKnnFloatVectorQuery that = (RerankKnnFloatVectorQuery) o;
|
||||||
return Objects.equals(query, that.query) && k == that.k;
|
return Objects.equals(query, that.query) && Arrays.equals(target, that.target) && k == that.k;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue