Skip to content

Commit

Permalink
Adding category to search criteria
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary A. Stafford committed Sep 16, 2018
1 parent 6a059ef commit 99c0e23
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -95,8 +95,9 @@ private QueryBuilder getQueryBuilder(String value) {

return QueryBuilders.disMaxQuery()
.add(matchPhraseQuery("post_title", value).boost(3))
.add(matchPhraseQuery("terms.post_tag.name", value).boost(3))
.add(matchPhraseQuery("post_excerpt", value).boost(2))
.add(matchPhraseQuery("post_excerpt", value).boost(3))
.add(matchPhraseQuery("terms.post_tag.name", value).boost(2))
.add(matchPhraseQuery("terms.category.name", value).boost(2))
.add(matchPhraseQuery("post_content", value).boost(1));
}

Expand Down

0 comments on commit 99c0e23

Please sign in to comment.