Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
private QueryBuilder getQueryBuilder(String value) {
value = value.toLowerCase();
return QueryBuilders.disMaxQuery()
.add(matchPhraseQuery("post_title", value).boost(3))
.add(matchPhraseQuery("post_excerpt", value).boost(3))
.add(matchPhraseQuery("", value).boost(2))
.add(matchPhraseQuery("", value).boost(2))
.add(matchPhraseQuery("post_content", value).boost(1));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.