more test fixes
This commit is contained in:
parent
63da68e480
commit
85f4c39b69
|
@ -762,6 +762,7 @@ public class SearchService extends AbstractLifecycleComponent<SearchService> {
|
||||||
XContentParser suggestParser = null;
|
XContentParser suggestParser = null;
|
||||||
try {
|
try {
|
||||||
suggestParser = XContentFactory.xContent(source.suggest()).createParser(source.suggest());
|
suggestParser = XContentFactory.xContent(source.suggest()).createParser(source.suggest());
|
||||||
|
suggestParser.nextToken();
|
||||||
this.elementParsers.get("suggest").parse(suggestParser, context);
|
this.elementParsers.get("suggest").parse(suggestParser, context);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String sSource = "_na_";
|
String sSource = "_na_";
|
||||||
|
|
|
@ -804,7 +804,8 @@ public final class SearchSourceBuilder extends ToXContentToBytes implements Writ
|
||||||
XContentBuilder xContentBuilder = XContentFactory.contentBuilder(parser.contentType()).copyCurrentStructure(parser);
|
XContentBuilder xContentBuilder = XContentFactory.contentBuilder(parser.contentType()).copyCurrentStructure(parser);
|
||||||
builder.innerHitsBuilder = xContentBuilder.bytes();
|
builder.innerHitsBuilder = xContentBuilder.bytes();
|
||||||
} else if (context.parseFieldMatcher().match(currentFieldName, SUGGEST_FIELD)) {
|
} else if (context.parseFieldMatcher().match(currentFieldName, SUGGEST_FIELD)) {
|
||||||
XContentBuilder xContentBuilder = XContentFactory.contentBuilder(parser.contentType()).copyCurrentStructure(parser);
|
XContentBuilder xContentBuilder = XContentFactory.contentBuilder(parser.contentType());
|
||||||
|
xContentBuilder.copyCurrentStructure(parser);
|
||||||
builder.suggestBuilder = xContentBuilder.bytes();
|
builder.suggestBuilder = xContentBuilder.bytes();
|
||||||
} else {
|
} else {
|
||||||
throw new ParsingException(parser.getTokenLocation(), "Unknown key for a " + token + " in [" + currentFieldName + "].",
|
throw new ParsingException(parser.getTokenLocation(), "Unknown key for a " + token + " in [" + currentFieldName + "].",
|
||||||
|
|
Loading…
Reference in New Issue