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/src/main/java/org/elasticsearch/xpack/inference/rest/RestGetInferenceModelAction.java
Copy file name to clipboardExpand all lines: x-pack/plugin/inference/src/yamlRestTest/resources/rest-api-spec/test/inference/10_semantic_text_field_mapping.yml
+57-76Lines changed: 57 additions & 76 deletions
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,11 @@ setup:
7
7
indices.create:
8
8
index: test-index
9
9
body:
10
+
settings:
11
+
index:
12
+
mapping:
13
+
semantic_text:
14
+
use_legacy_format: false
10
15
mappings:
11
16
properties:
12
17
sparse_field:
@@ -18,16 +23,6 @@ setup:
18
23
19
24
---
20
25
"Indexes sparse vector document":
21
-
- requires:
22
-
test_runner_features: [capabilities]
23
-
24
-
- skip:
25
-
reason: Test targets semantic text without inference metadata fields
26
-
capabilities:
27
-
- method: GET
28
-
path: /_inference
29
-
capabilities: [inference_metadata_fields]
30
-
31
26
# Checks mapping is not updated until first doc arrives
32
27
- do:
33
28
indices.get_mapping:
@@ -42,25 +37,28 @@ setup:
42
37
index: test-index
43
38
id: doc_1
44
39
body:
45
-
sparse_field:
46
-
text: "these are not the droids you're looking for. He's free to go around"
40
+
sparse_field:"these are not the droids you're looking for. He's free to go around"
41
+
_inference_fields.sparse_field:
47
42
inference:
48
43
inference_id: sparse-inference-id
49
44
model_settings:
50
45
task_type: sparse_embedding
51
46
chunks:
52
-
- text: "these are not the droids you're looking for"
53
-
embeddings:
54
-
feature_0: 1.0
55
-
feature_1: 2.0
56
-
feature_2: 3.0
57
-
feature_3: 4.0
58
-
- text: "He's free to go around"
59
-
embeddings:
60
-
feature_4: 0.1
61
-
feature_5: 0.2
62
-
feature_6: 0.3
63
-
feature_7: 0.4
47
+
sparse_field:
48
+
- start_offset: 0
49
+
end_offset: 44
50
+
embeddings:
51
+
feature_0: 1.0
52
+
feature_1: 2.0
53
+
feature_2: 3.0
54
+
feature_3: 4.0
55
+
- start_offset: 44
56
+
end_offset: 67
57
+
embeddings:
58
+
feature_4: 0.1
59
+
feature_5: 0.2
60
+
feature_6: 0.3
61
+
feature_7: 0.4
64
62
65
63
# Checks mapping is updated when first doc arrives
66
64
- do:
@@ -77,14 +75,6 @@ setup:
77
75
- requires:
78
76
cluster_features: "gte_v8.16.0"
79
77
reason: field_caps support for semantic_text added in 8.16.0
80
-
test_runner_features: [ capabilities ]
81
-
82
-
- skip:
83
-
reason: Test targets semantic text without inference metadata fields
84
-
capabilities:
85
-
- method: GET
86
-
path: /_inference
87
-
capabilities: [ inference_metadata_fields ]
88
78
89
79
- do:
90
80
field_caps:
@@ -111,25 +101,28 @@ setup:
111
101
index: test-index
112
102
id: doc_1
113
103
body:
114
-
sparse_field:
115
-
text: "these are not the droids you're looking for. He's free to go around"
104
+
sparse_field:"these are not the droids you're looking for. He's free to go around"
105
+
_inference_fields.sparse_field:
116
106
inference:
117
107
inference_id: sparse-inference-id
118
108
model_settings:
119
109
task_type: sparse_embedding
120
110
chunks:
121
-
- text: "these are not the droids you're looking for"
122
-
embeddings:
123
-
feature_0: 1.0
124
-
feature_1: 2.0
125
-
feature_2: 3.0
126
-
feature_3: 4.0
127
-
- text: "He's free to go around"
128
-
embeddings:
129
-
feature_4: 0.1
130
-
feature_5: 0.2
131
-
feature_6: 0.3
132
-
feature_7: 0.4
111
+
sparse_field:
112
+
- start_offset: 0
113
+
end_offset: 44
114
+
embeddings:
115
+
feature_0: 1.0
116
+
feature_1: 2.0
117
+
feature_2: 3.0
118
+
feature_3: 4.0
119
+
- start_offset: 44
120
+
end_offset: 67
121
+
embeddings:
122
+
feature_4: 0.1
123
+
feature_5: 0.2
124
+
feature_6: 0.3
125
+
feature_7: 0.4
133
126
refresh: true
134
127
135
128
- do:
@@ -157,16 +150,6 @@ setup:
157
150
158
151
---
159
152
"Indexes dense vector document":
160
-
- requires:
161
-
test_runner_features: [ capabilities ]
162
-
163
-
- skip:
164
-
reason: Test targets semantic text without inference metadata fields
165
-
capabilities:
166
-
- method: GET
167
-
path: /_inference
168
-
capabilities: [ inference_metadata_fields ]
169
-
170
153
# Checks mapping is not updated until first doc arrives
171
154
- do:
172
155
indices.get_mapping:
@@ -181,8 +164,8 @@ setup:
181
164
index: test-index
182
165
id: doc_2
183
166
body:
184
-
dense_field:
185
-
text: "these are not the droids you're looking for. He's free to go around"
167
+
dense_field:"these are not the droids you're looking for. He's free to go around"
168
+
_inference_fields.dense_field:
186
169
inference:
187
170
inference_id: dense-inference-id
188
171
model_settings:
@@ -191,10 +174,13 @@ setup:
191
174
similarity: cosine
192
175
element_type: float
193
176
chunks:
194
-
- text: "these are not the droids you're looking for"
0 commit comments