@@ -38,6 +38,12 @@ that the model created based on your text - must be created. The destination
3838index must have a field with the <<rank-features, `rank_features`>> field type
3939to index the ELSER output.
4040
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+
4147[source,console]
4248----
4349PUT my-index
@@ -47,16 +53,18 @@ PUT my-index
4753 "ml.tokens": {
4854 "type": "rank_features" <1>
4955 },
50- "text_field ": {
51- "type": "text" <2 >
56+ "text ": { <2>
57+ "type": "text" <3 >
5258 }
5359 }
5460 }
5561}
5662----
5763// TEST[skip:TBD]
5864<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.
6068
6169
6270[discrete]
@@ -76,11 +84,11 @@ PUT _ingest/pipeline/elser-v1-test
7684 "inference": {
7785 "model_id": ".elser_model_1",
7886 "target_field": "ml",
79- "field_map": {
87+ "field_map": { <1>
8088 "text": "text_field"
8189 },
8290 "inference_config": {
83- "text_expansion": { <1 >
91+ "text_expansion": { <2 >
8492 "results_field": "tokens"
8593 }
8694 }
@@ -90,7 +98,10 @@ PUT _ingest/pipeline/elser-v1-test
9098}
9199----
92100// 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
94105processor.
95106
96107
0 commit comments