@@ -38,6 +38,12 @@ that the model created based on your text - must be created. The destination
38
38
index must have a field with the <<rank-features, `rank_features`>> field type
39
39
to index the ELSER output.
40
40
41
+ NOTE: ELSER output must be ingested into a field with the `rank_features` field
42
+ type. Otherwise, {es} interprets the token-weight pairs as a massive amount of
43
+ fields in a document. If you get an error similar to this `"Limit of total fields [1000] has been exceeded while adding
44
+ new fields"` then the ELSER output field is not mapped properly and it has a
45
+ field type different than `rank_features`.
46
+
41
47
[source,console]
42
48
----
43
49
PUT my-index
@@ -47,16 +53,18 @@ PUT my-index
47
53
"ml.tokens": {
48
54
"type": "rank_features" <1>
49
55
},
50
- "text_field ": {
51
- "type": "text" <2 >
56
+ "text ": { <2>
57
+ "type": "text" <3 >
52
58
}
53
59
}
54
60
}
55
61
}
56
62
----
57
63
// TEST[skip:TBD]
58
64
<1> The field that contains the prediction is a `rank_features` field.
59
- <2> The text field from which to create the sparse vector representation.
65
+ <2> The name of the field from which to create the sparse vector representation.
66
+ In this example, the name of the field is `text`.
67
+ <3> The field type which is text in this example.
60
68
61
69
62
70
[discrete]
@@ -76,11 +84,11 @@ PUT _ingest/pipeline/elser-v1-test
76
84
"inference": {
77
85
"model_id": ".elser_model_1",
78
86
"target_field": "ml",
79
- "field_map": {
87
+ "field_map": { <1>
80
88
"text": "text_field"
81
89
},
82
90
"inference_config": {
83
- "text_expansion": { <1 >
91
+ "text_expansion": { <2 >
84
92
"results_field": "tokens"
85
93
}
86
94
}
@@ -90,7 +98,10 @@ PUT _ingest/pipeline/elser-v1-test
90
98
}
91
99
----
92
100
// TEST[skip:TBD]
93
- <1> The `text_expansion` inference type needs to be used in the {infer} ingest
101
+ <1> The `field_map` object maps the input document field name (which is `text`
102
+ in this example) to the name of the field that the model expects (which is
103
+ always `text_field`).
104
+ <2> The `text_expansion` inference type needs to be used in the {infer} ingest
94
105
processor.
95
106
96
107
0 commit comments