fix to sort parsing in SearchService
This commit is contained in:
parent
585ed07c5b
commit
52d9664993
|
@ -695,16 +695,20 @@ public class SearchService extends AbstractLifecycleComponent<SearchService> {
|
|||
XContentParser completeSortParser = null;
|
||||
try {
|
||||
XContentBuilder completeSortBuilder = XContentFactory.jsonBuilder();
|
||||
completeSortBuilder.startArray();
|
||||
completeSortBuilder.startObject();
|
||||
completeSortBuilder.startArray("sort");
|
||||
for (BytesReference sort : source.sorts()) {
|
||||
XContentParser parser = XContentFactory.xContent(sort).createParser(sort);
|
||||
parser.nextToken();
|
||||
completeSortBuilder.copyCurrentStructure(parser);
|
||||
}
|
||||
completeSortBuilder.endArray();
|
||||
completeSortBuilder.endObject();
|
||||
BytesReference completeSortBytes = completeSortBuilder.bytes();
|
||||
completeSortParser = XContentFactory.xContent(completeSortBytes).createParser(completeSortBytes);
|
||||
completeSortParser.nextToken();
|
||||
completeSortParser.nextToken();
|
||||
completeSortParser.nextToken();
|
||||
this.elementParsers.get("sort").parse(completeSortParser, context);
|
||||
} catch (Exception e) {
|
||||
String sSource = "_na_";
|
||||
|
|
Loading…
Reference in New Issue