mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-06-29 23:32:12 +00:00
DATAES-643: Added searchType to prepareSearch() in RestTemplate (#310)
Original PR: #310
This commit is contained in:
parent
4798136074
commit
054c02bd41
@ -140,6 +140,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|||||||
* @author Martin Choraine
|
* @author Martin Choraine
|
||||||
* @author Farid Azaza
|
* @author Farid Azaza
|
||||||
* @author Peter-Josef Meisch
|
* @author Peter-Josef Meisch
|
||||||
|
* @author Mathias Teier
|
||||||
*/
|
*/
|
||||||
public class ElasticsearchRestTemplate
|
public class ElasticsearchRestTemplate
|
||||||
implements ElasticsearchOperations, EsClient<RestHighLevelClient>, ApplicationContextAware {
|
implements ElasticsearchOperations, EsClient<RestHighLevelClient>, ApplicationContextAware {
|
||||||
@ -1328,6 +1329,10 @@ public class ElasticsearchRestTemplate
|
|||||||
request.preference(query.getPreference());
|
request.preference(query.getPreference());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (query.getSearchType() != null) {
|
||||||
|
request.searchType(query.getSearchType());
|
||||||
|
}
|
||||||
|
|
||||||
request.source(sourceBuilder);
|
request.source(sourceBuilder);
|
||||||
return request;
|
return request;
|
||||||
}
|
}
|
||||||
|
@ -78,6 +78,7 @@ import org.springframework.util.Assert;
|
|||||||
* @author Farid Azaza
|
* @author Farid Azaza
|
||||||
* @author Martin Choraine
|
* @author Martin Choraine
|
||||||
* @author Peter-Josef Meisch
|
* @author Peter-Josef Meisch
|
||||||
|
* @author Mathias Teier
|
||||||
* @since 3.2
|
* @since 3.2
|
||||||
*/
|
*/
|
||||||
public class ReactiveElasticsearchTemplate implements ReactiveElasticsearchOperations {
|
public class ReactiveElasticsearchTemplate implements ReactiveElasticsearchOperations {
|
||||||
@ -283,6 +284,10 @@ public class ReactiveElasticsearchTemplate implements ReactiveElasticsearchOpera
|
|||||||
request.preference(query.getPreference());
|
request.preference(query.getPreference());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (query.getSearchType() != null) {
|
||||||
|
request.searchType(query.getSearchType());
|
||||||
|
}
|
||||||
|
|
||||||
Pageable pageable = query.getPageable();
|
Pageable pageable = query.getPageable();
|
||||||
|
|
||||||
if (pageable.isPaged()) {
|
if (pageable.isPaged()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user