Skip to content

Commit

Permalink
Updating build.
Browse files Browse the repository at this point in the history
  • Loading branch information
jzonthemtn committed Nov 10, 2024
1 parent b97648a commit 216ef07
Showing 1 changed file with 25 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,32 +168,31 @@ private Map<String, Set<ClickthroughRate>> getClickthroughRate(final int maxRank
// TODO: Use maxRank in place of the hardcoded 20.
// TODO: Allow for a time period and for a specific application.

final String query = """
{
"bool": {
"should": [
{
"term": {
"action_name": "click"
}
},
{
"term": {
"action_name": "view"
}
}
],
"must": [
{
"range": {
"event_attributes.position.index": {
"lte": 20
}
}
}
]
}
}""";
final String query = "{\n" +
" \"bool\": {\n" +
" \"should\": [\n" +
" {\n" +
" \"term\": {\n" +
" \"action_name\": \"click\"\n" +
" }\n" +
" },\n" +
" {\n" +
" \"term\": {\n" +
" \"action_name\": \"view\"\n" +
" }\n" +
" }\n" +
" ],\n" +
" \"must\": [\n" +
" {\n" +
" \"range\": {\n" +
" \"event_attributes.position.index\": {\n" +
" \"lte\": 20\n" +
" }\n" +
" }\n" +
" }\n" +
" ]\n" +
" }\n" +
" }";

final BoolQueryBuilder queryBuilder = new BoolQueryBuilder().must(new WrapperQueryBuilder(query));
final SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder().query(queryBuilder).size(1000);
Expand Down

0 comments on commit 216ef07

Please sign in to comment.