Skip to content

Commit f9c7ad7

Browse files
committed
Change method name
1 parent 008e0c0 commit f9c7ad7

File tree

6 files changed

+8
-7
lines changed

6 files changed

+8
-7
lines changed

server/src/main/java/org/elasticsearch/inference/ChunkedInference.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ public interface ChunkedInference {
2121
* Implementations of this function serialize their embeddings to {@link BytesReference} for storage in semantic text fields.
2222
*
2323
* @param xcontent provided by the SemanticTextField
24-
* @return an iterator of the serialized {@link Chunk} which includes the matched text (input) and bytes reference (output/embedding).
24+
* @return an iterator of the serialized {@link Chunk} which includes the offset into the input text and bytes reference
25+
* (output/embedding).
2526
*/
26-
Iterator<Chunk> chunksAsMatchedTextAndByteReference(XContent xcontent) throws IOException;
27+
Iterator<Chunk> chunksAsByteReference(XContent xcontent) throws IOException;
2728

2829
/**
2930
* A chunk of inference results containing the substring location in the original text and the bytes reference.

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/inference/results/ChunkedInferenceEmbedding.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public static List<ChunkedInference> listOf(List<String> inputs, SparseEmbedding
4040
}
4141

4242
@Override
43-
public Iterator<Chunk> chunksAsMatchedTextAndByteReference(XContent xcontent) throws IOException {
43+
public Iterator<Chunk> chunksAsByteReference(XContent xcontent) throws IOException {
4444
var asChunk = new ArrayList<Chunk>();
4545
for (var chunk : chunks()) {
4646
asChunk.add(chunk.toChunk(xcontent));

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/inference/results/ChunkedInferenceError.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
public record ChunkedInferenceError(Exception exception) implements ChunkedInference {
1717

1818
@Override
19-
public Iterator<Chunk> chunksAsMatchedTextAndByteReference(XContent xcontent) {
19+
public Iterator<Chunk> chunksAsByteReference(XContent xcontent) {
2020
return Collections.emptyIterator();
2121
}
2222
}

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/action/filter/ShardBulkInferenceActionFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ static IndexRequest getIndexRequestOrNull(DocWriteRequest<?> docWriteRequest) {
604604

605605
private static class EmptyChunkedInference implements ChunkedInference {
606606
@Override
607-
public Iterator<Chunk> chunksAsMatchedTextAndByteReference(XContent xcontent) {
607+
public Iterator<Chunk> chunksAsByteReference(XContent xcontent) {
608608
return Collections.emptyIterator();
609609
}
610610
}

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/mapper/SemanticTextField.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ public static List<Chunk> toSemanticTextFieldChunks(
275275
boolean useLegacyFormat
276276
) throws IOException {
277277
List<Chunk> chunks = new ArrayList<>();
278-
Iterator<ChunkedInference.Chunk> it = results.chunksAsMatchedTextAndByteReference(contentType.xContent());
278+
Iterator<ChunkedInference.Chunk> it = results.chunksAsByteReference(contentType.xContent());
279279
while (it.hasNext()) {
280280
chunks.add(toSemanticTextFieldChunk(input, offsetAdjustment, it.next(), useLegacyFormat));
281281
}

x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/mapper/SemanticTextFieldTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ public static SemanticTextField semanticTextFieldFromChunkedInferenceResults(
243243
final List<SemanticTextField.Chunk> chunks = new ArrayList<>(inputs.size());
244244
int offsetAdjustment = 0;
245245
Iterator<String> inputsIt = inputs.iterator();
246-
Iterator<ChunkedInference.Chunk> chunkIt = results.chunksAsMatchedTextAndByteReference(contentType.xContent());
246+
Iterator<ChunkedInference.Chunk> chunkIt = results.chunksAsByteReference(contentType.xContent());
247247
while (inputsIt.hasNext() && chunkIt.hasNext()) {
248248
String input = inputsIt.next();
249249
var chunk = chunkIt.next();

0 commit comments

Comments
 (0)