Skip to content

Commit ccb530e

Browse files
authored
Ensure sentence overlap is considered in SentenceBoundaryChunkingSettings equals/hashCode (elastic#126250) (elastic#126291)
1 parent 54e5ab1 commit ccb530e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/chunking/SentenceBoundaryChunkingSettings.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@ public boolean equals(Object o) {
134134
if (this == o) return true;
135135
if (o == null || getClass() != o.getClass()) return false;
136136
SentenceBoundaryChunkingSettings that = (SentenceBoundaryChunkingSettings) o;
137-
return Objects.equals(maxChunkSize, that.maxChunkSize);
137+
return Objects.equals(maxChunkSize, that.maxChunkSize) && Objects.equals(sentenceOverlap, that.sentenceOverlap);
138138
}
139139

140140
@Override
141141
public int hashCode() {
142-
return Objects.hash(maxChunkSize);
142+
return Objects.hash(maxChunkSize, sentenceOverlap);
143143
}
144144
}

0 commit comments

Comments
 (0)