Make excuses for SearchSourceBuilder.parseXContent

Its useful when you need to have defaults that don't match
SearchSourceBuilder's defaults. You build your SearchSourceBuilder, set the
defaults, and then layer the XContent on top of that.
This commit is contained in:
Nik Everett 2016-02-29 13:50:46 -05:00
parent d4113d77cf
commit e17d8bda93
1 changed files with 3 additions and 1 deletions

View File

@ -745,7 +745,9 @@ public final class SearchSourceBuilder extends ToXContentToBytes implements Writ
}
/**
* Parse some xContent into this SearchSourceBuilder, overwriting any values specified in the xContent.
* Parse some xContent into this SearchSourceBuilder, overwriting any values specified in the xContent. Use this if you need to set up
* different defaults than a regular SearchSourceBuilder would have and use
* {@link #fromXContent(XContentParser, QueryParseContext, AggregatorParsers)} if you have normal defaults.
*/
public void parseXContent(XContentParser parser, QueryParseContext context, AggregatorParsers aggParsers) throws IOException {
XContentParser.Token token = parser.currentToken();