diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/SearchRequest.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/SearchRequest.java index 6af225ab15c..fff986e951c 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/SearchRequest.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/SearchRequest.java @@ -294,6 +294,14 @@ public class SearchRequest implements ActionRequest { return source(source, 0, source.length, false); } + + /** + * The search source to execute. + */ + public SearchRequest source(byte[] source, int offset, int length) { + return source(source, offset, length, false); + } + /** * The search source to execute. */ @@ -373,6 +381,13 @@ public class SearchRequest implements ActionRequest { return extraSource(source, 0, source.length, false); } + /** + * Allows to provide additional source that will be used as well. + */ + public SearchRequest extraSource(byte[] source, int offset, int length) { + return extraSource(source, offset, length, false); + } + /** * Allows to provide additional source that will be used as well. */ diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/client/action/search/SearchRequestBuilder.java b/modules/elasticsearch/src/main/java/org/elasticsearch/client/action/search/SearchRequestBuilder.java index 273395c9163..8b7721903df 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/client/action/search/SearchRequestBuilder.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/client/action/search/SearchRequestBuilder.java @@ -28,6 +28,7 @@ import org.elasticsearch.action.search.SearchType; import org.elasticsearch.client.Client; import org.elasticsearch.client.action.support.BaseRequestBuilder; import org.elasticsearch.common.unit.TimeValue; +import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.query.xcontent.XContentFilterBuilder; import org.elasticsearch.index.query.xcontent.XContentQueryBuilder; import org.elasticsearch.search.Scroll; @@ -474,6 +475,78 @@ public class SearchRequestBuilder extends BaseRequestBuilder