Created
July 6, 2011 17:40
-
-
Save arielamato/1067840 to your computer and use it in GitHub Desktop.
Sample query
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
private void addAgeSearchTerm(final BoolQueryBuilder queryBuilder, final Integer minAge, final Integer maxAge) { | |
for (int i = 0; i <= 4; i++) { | |
queryBuilder.should(new RangeQueryBuilder("age").from(minAge).to(maxAge + i) | |
.boost((ageWeight / (i + 1)))); | |
} | |
for (int i = 0; i <= 3; i++) { | |
queryBuilder.should(new RangeQueryBuilder("age").from(minAge - i).to(maxAge) | |
.boost((ageWeight / (i + 1)))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment