Skip to content

Commit 17ec3a8

Browse files
committed
Minor cleanup
1 parent 4519d61 commit 17ec3a8

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

server/src/main/java/org/elasticsearch/search/rank/feature/SnippetRankInput.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import org.elasticsearch.common.io.stream.StreamOutput;
1414

1515
import java.io.IOException;
16+
import java.util.Objects;
1617

1718
/**
1819
* Defines a custom rank input to rerank results based on snippets rather than full field contents.
@@ -56,6 +57,21 @@ public void writeTo(StreamOutput out) throws IOException {
5657
out.writeVInt(tokenSizeLimit);
5758
}
5859

60+
@Override
61+
public boolean equals(Object o) {
62+
if (this == o) return true;
63+
if (o == null || getClass() != o.getClass()) return false;
64+
SnippetRankInput that = (SnippetRankInput) o;
65+
return tokenSizeLimit == that.tokenSizeLimit
66+
&& Objects.equals(snippets, that.snippets)
67+
&& Objects.equals(inferenceText, that.inferenceText);
68+
}
69+
70+
@Override
71+
public int hashCode() {
72+
return Objects.hash(snippets, inferenceText, tokenSizeLimit);
73+
}
74+
5975
@Override
6076
public String name() {
6177
return NAME;

0 commit comments

Comments
 (0)