How to use script in msearch request in Elasticsearch Java client 8

my msearch request is like below:

{}
{ "query": { "bool": { "must": { "match_all": {} }, "filter": { "geo_distance": { "distance": "3km", "distance_type": "arc", "latLon": { "lat": 12.9322, "lon": 77.6904 } } } } }, "script_fields": { "distance_in_m": { "script": "doc['latLon'].arcDistance(40.00327, 15.36496)" } } }
{}
{ "query": { "bool": { "must": { "match_all": {} }, "filter": { "geo_distance": { "distance": "3km", "distance_type": "arc", "latLon": { "lat": 12.9322, "lon": 77.6904 } } } } }, "script_fields": { "distance_in_m": { "script": "doc['latLon'].arcDistance(40.00327, 15.36496)" } } }

How to write this in Elasticsearch java-client 8? In Elasticsearch java-client version 7 this is possible via Multi-Search API | Java REST Client [7.17] | Elastic but in version 8 not able to find how to add script_fields for each query separately.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.