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: docs/user/ppl/interfaces/endpoint.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -204,7 +204,7 @@ Expected output (trimmed):
204
204
205
205
## Highlight
206
206
207
-
You can add a `highlight` parameter to the PPL request body to enable search-result highlighting. When enabled, the response includes a top-level `highlights` array containing matching fragments with the specified tags. Each entry in the `highlights` array corresponds to the row at the same index in `datarows`.
207
+
You can add a `highlight` parameter to the PPL request body to enable search-result highlighting. This parameter follows the same semantics as the [OpenSearch highlight API](https://docs.opensearch.org/latest/search-plugins/searching-data/highlight/). When enabled, the response includes a top-level `highlights` array containing matching fragments with the specified tags. Each entry in the `highlights` array corresponds to the row at the same index in `datarows`.
208
208
209
209
Two formats are supported:
210
210
@@ -278,11 +278,11 @@ Expected output (trimmed):
278
278
| `fields` | Object | Yes | An object whose keys are field names or wildcards (e.g. `{"*": {}}`) to highlight. |
279
279
| `pre_tags` | Array of string | No | Tags inserted before highlighted tokens. Defaults to `<em>`. |
280
280
| `post_tags` | Array of string | No | Tags inserted after highlighted tokens. Defaults to `</em>`. |
281
-
| `fragment_size` | Integer | No | Maximum character size of a highlight fragment. Defaults to `2147483647` (returns the full field value). |
281
+
| `fragment_size` | Integer | No | Maximum character size of a highlight fragment. Defaults to `100`. |
282
282
283
283
### Notes
284
284
285
285
- Highlighting requires a search query in the PPL statement (e.g. `source=accounts "Holmes"`). Without a query, the `highlights` array entries will be empty.
286
286
- The `highlights` array in the response is parallel to `datarows` — each entry contains the highlighted fragments for the corresponding row.
287
-
- In the simple array format, `["*"]` highlights all fields. Specific terms like `["error", "login"]` highlight those terms across all fields.
287
+
- In the simple array format, `["*"]` highlights all fields. Specific field names like `["firstname", "lastname"]` scope highlighting to those fields only.
288
288
- In the object format, only the keys of the `fields` object are used; per-field options inside the value objects are currently ignored.
0 commit comments