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 64707ae commit b97648a
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 29 deletions.
3 changes: 0 additions & 3 deletions opensearch-search-quality-evaluation-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ ext {
group = 'org.opensearch'
version = "${evalVersion}"

sourceCompatibility = 17
targetCompatibility = 17

// disabling some unnecessary validations for this plugin
testingConventions.enabled = false
forbiddenApis.ignoreFailures = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,32 +179,59 @@ 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
}
}
}
]
}
}""";
/**
* {
* "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 b97648a

Please sign in to comment.