You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: x-pack/plugin/inference/qa/test-service-plugin/src/main/java/org/elasticsearch/xpack/inference/mock/AbstractTestInferenceService.java
Copy file name to clipboardExpand all lines: x-pack/plugin/inference/qa/test-service-plugin/src/main/java/org/elasticsearch/xpack/inference/mock/TestDenseInferenceServiceExtension.java
Copy file name to clipboardExpand all lines: x-pack/plugin/inference/qa/test-service-plugin/src/main/java/org/elasticsearch/xpack/inference/mock/TestSparseInferenceServiceExtension.java
Copy file name to clipboardExpand all lines: x-pack/plugin/inference/src/yamlRestTest/resources/rest-api-spec/test/inference/25_semantic_text_field_mapping_chunking.yml
+96-7Lines changed: 96 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -75,6 +75,22 @@ setup:
75
75
max_chunk_size: 10
76
76
overlap: 1
77
77
78
+
- do:
79
+
indices.create:
80
+
index: custom-chunking-dense
81
+
body:
82
+
mappings:
83
+
properties:
84
+
keyword_field:
85
+
type: keyword
86
+
inference_field:
87
+
type: semantic_text
88
+
inference_id: dense-inference-id
89
+
chunking_settings:
90
+
strategy: word
91
+
max_chunk_size: 10
92
+
overlap: 1
93
+
78
94
- do:
79
95
index:
80
96
index: default-chunking-sparse
@@ -93,25 +109,57 @@ setup:
93
109
inference_field: "Elasticsearch is an open source, distributed, RESTful, search engine which is built on top of Lucene internally and enjoys all the features it provides."
94
110
refresh: true
95
111
112
+
- do:
113
+
index:
114
+
index: default-chunking-dense
115
+
id: doc_3
116
+
body:
117
+
keyword_field: "default sentence chunking"
118
+
inference_field: "Elasticsearch is an open source, distributed, RESTful, search engine which is built on top of Lucene internally and enjoys all the features it provides."
119
+
refresh: true
120
+
121
+
- do:
122
+
index:
123
+
index: custom-chunking-dense
124
+
id: doc_4
125
+
body:
126
+
keyword_field: "custom word chunking"
127
+
inference_field: "Elasticsearch is an open source, distributed, RESTful, search engine which is built on top of Lucene internally and enjoys all the features it provides."
128
+
refresh: true
129
+
96
130
---
97
131
"We return chunking configurations with mappings":
- match: { hits.hits.0.highlight.inference_field.0: "Elasticsearch is an open source, distributed, RESTful, search engine which is built on top of Lucene internally and enjoys all" }
153
-
- match: { hits.hits.0.highlight.inference_field.1: " the features it provides." }
200
+
- match: { hits.hits.0.highlight.inference_field.0: "Elasticsearch is an open source, distributed, RESTful, search engine which" }
201
+
- match: { hits.hits.0.highlight.inference_field.1: " which is built on top of Lucene internally and enjoys" }
154
202
203
+
---
204
+
"We return different chunks based on configured chunking overrides or model defaults for dense embeddings":
- match: { hits.hits.0.highlight.inference_field.0: "Elasticsearch is an open source, distributed, RESTful, search engine which is built on top of Lucene internally and enjoys all the features it provides." }
0 commit comments