Skip to content

Instantly share code, notes, and snippets.

Got it, you want to limit the fields returned in each document based on the length of their values. In Elasticsearch, you can achieve this using the `source` parameter to specify which fields to include in the search response, along with scripting to filter the fields based on their length. Here's an example:
```json
{
"_source": {
"includes": [
"*",
"field1",
"field2"
],