Created
August 18, 2016 11:51
-
-
Save nanlabsweb/0a83ccd3306c2ec409af88c762709056 to your computer and use it in GitHub Desktop.
POST - Retrieve search source builder.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SearchSourceBuilder getSearchSourceBuilder(QueryWrapper queryWrapper) { | |
SearchSourceBuilder sourceBuilder = new SearchSourceBuilder() | |
if (queryWrapper.query) { | |
sourceBuilder.query(queryWrapper.query) | |
} | |
if (queryWrapper.fields) { | |
sourceBuilder.fields(queryWrapper.fields) | |
} | |
// ... same for sorting, pagination, agregation, highlighting, etc. | |
return sourceBuilder | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment