diff --git a/opensearch-search-quality-evaluation-plugin/build.gradle b/opensearch-search-quality-evaluation-plugin/build.gradle index dcfb8da..0e0ae61 100644 --- a/opensearch-search-quality-evaluation-plugin/build.gradle +++ b/opensearch-search-quality-evaluation-plugin/build.gradle @@ -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 diff --git a/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/judgments/clickmodel/coec/CoecClickModel.java b/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/judgments/clickmodel/coec/CoecClickModel.java index 624a75e..3e1be5e 100644 --- a/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/judgments/clickmodel/coec/CoecClickModel.java +++ b/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/judgments/clickmodel/coec/CoecClickModel.java @@ -179,32 +179,59 @@ private Map> 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); diff --git a/opensearch-search-quality-implicit-judgments/build.gradle b/opensearch-search-quality-implicit-judgments/build.gradle index 41e2da8..5507280 100644 --- a/opensearch-search-quality-implicit-judgments/build.gradle +++ b/opensearch-search-quality-implicit-judgments/build.gradle @@ -15,9 +15,6 @@ repositories { maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" } } -sourceCompatibility = 17 -targetCompatibility = 17 - test { useJUnitPlatform() } diff --git a/opensearch-search-quality-implicit-judgments/src/main/java/org/opensearch/qef/clickmodel/coec/CoecClickModel.java b/opensearch-search-quality-implicit-judgments/src/main/java/org/opensearch/qef/clickmodel/coec/CoecClickModel.java index 80c0223..62dc496 100644 --- a/opensearch-search-quality-implicit-judgments/src/main/java/org/opensearch/qef/clickmodel/coec/CoecClickModel.java +++ b/opensearch-search-quality-implicit-judgments/src/main/java/org/opensearch/qef/clickmodel/coec/CoecClickModel.java @@ -168,32 +168,31 @@ private Map> 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);