File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/rank/textsimilarity Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 1111import org .elasticsearch .common .io .stream .StreamOutput ;
1212import org .elasticsearch .common .io .stream .Writeable ;
1313import org .elasticsearch .inference .ChunkingSettings ;
14+ import org .elasticsearch .xcontent .ToXContentObject ;
15+ import org .elasticsearch .xcontent .XContentBuilder ;
1416import org .elasticsearch .xpack .core .inference .chunking .ChunkingSettingsBuilder ;
1517import org .elasticsearch .xpack .core .inference .chunking .SentenceBoundaryChunkingSettings ;
1618
1719import java .io .IOException ;
1820import java .util .Map ;
1921import java .util .Objects ;
2022
21- public class ChunkScorerConfig implements Writeable {
23+ public class ChunkScorerConfig implements Writeable , ToXContentObject {
2224
2325 public final Integer size ;
2426 private final String inferenceText ;
@@ -97,4 +99,15 @@ public boolean equals(Object o) {
9799 public int hashCode () {
98100 return Objects .hash (size , inferenceText , chunkingSettings );
99101 }
102+
103+ @ Override
104+ public XContentBuilder toXContent (XContentBuilder builder , Params params ) throws IOException {
105+ builder .startObject ();
106+ builder .field ("size" , size );
107+ builder .field ("inference_text" , inferenceText );
108+ builder .field ("chunking_settings" );
109+ chunkingSettings .toXContent (builder , params );
110+ builder .endObject ();
111+ return builder ;
112+ }
100113}
You can’t perform that action at this time.
0 commit comments