File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
java-client/src/test/java/co/elastic/clients/elasticsearch/model Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1919
2020package co .elastic .clients .elasticsearch .model ;
2121
22+ import co .elastic .clients .elasticsearch ._types .GeoDistanceSort ;
23+ import co .elastic .clients .elasticsearch ._types .SortOptions ;
2224import co .elastic .clients .elasticsearch .cat .NodesResponse ;
2325import co .elastic .clients .elasticsearch .core .GetSourceResponse ;
2426import co .elastic .clients .json .JsonpDeserializable ;
@@ -131,4 +133,38 @@ public void testJsonpValuesToString() {
131133 JsonpUtils .toString (Json .createObjectBuilder ().build ());
132134 });
133135 }
136+
137+ @ Test
138+ public void testSortOptionsDeserializer () {
139+
140+ String customField = """
141+ {
142+ "term" : "asc"
143+ }
144+ """ ;
145+
146+ SortOptions so = SortOptions .of (b ->b .withJson (new StringReader (customField )));
147+
148+ String score = """
149+ "_score"
150+ """ ;
151+
152+ so = SortOptions .of (b ->b .withJson (new StringReader (score )));
153+
154+ String geoDistance = """
155+ {
156+ "_geo_distance" : {
157+ "pin.location" : "<-70>, <40>",
158+ "order" : "asc",
159+ "unit" : "km",
160+ "mode" : "min",
161+ "distance_type" : "arc",
162+ "ignore_unmapped": true
163+ }
164+ }
165+ """ ;
166+
167+ so = SortOptions .of (b ->b .withJson (new StringReader (geoDistance )));
168+
169+ }
134170}
You can’t perform that action at this time.
0 commit comments