From a2a2f8ff025aed392a16a1f7686ab49fe96d41a7 Mon Sep 17 00:00:00 2001 From: Sonu Sharma Date: Fri, 29 May 2026 22:44:29 +0530 Subject: [PATCH 1/7] QueryElevation support for Combined Query feature --- .../component/CombinedQueryComponent.java | 1 + .../component/QueryElevationComponent.java | 42 ++++++++++++++- .../conf/solrconfig-combined-query.xml | 15 +++++- .../component/CombinedQuerySolrCloudTest.java | 51 +++++++++++++++++++ ...DistributedCombinedQueryComponentTest.java | 46 +++++++++++++++++ 5 files changed, 152 insertions(+), 3 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/handler/component/CombinedQueryComponent.java b/solr/core/src/java/org/apache/solr/handler/component/CombinedQueryComponent.java index 8b097bc304d..1e5c0b11aa1 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/CombinedQueryComponent.java +++ b/solr/core/src/java/org/apache/solr/handler/component/CombinedQueryComponent.java @@ -151,6 +151,7 @@ public void prepare(ResponseBuilder rb) throws IOException { final var unparsedQuery = params.get(queryKey); ResponseBuilder rbNew = new ResponseBuilder(rb.req, new SolrQueryResponse(), rb.components); rbNew.setQueryString(unparsedQuery); + rbNew.setDebug(rb.isDebug()); super.prepare(rbNew); crb.setFilters(rbNew.getFilters()); crb.responseBuilders.add(rbNew); diff --git a/solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.java b/solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.java index 2bc9ae3d0bb..7e079b95882 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.java +++ b/solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.java @@ -112,6 +112,7 @@ public class QueryElevationComponent extends SearchComponent implements SolrCore @VisibleForTesting static final String FIELD_TYPE = "queryFieldType"; @VisibleForTesting static final String CONFIG_FILE = "config-file"; private static final String EXCLUDE = "exclude"; + private static final String DEBUG_QUERY_BOOSTING = "queryBoosting"; /** * @see #getBoostDocs(SolrIndexSearcher, Set, Map) @@ -488,6 +489,45 @@ public void prepare(ResponseBuilder rb) throws IOException { return; } + if (rb instanceof CombinedQueryResponseBuilder crb) { + prepareCombined(crb); + } else { + prepareElevationComponent(rb); + } + } + + /** + * Elevates each subquery and mirrors the resulting SortSpec/filters onto the parent crb so {@link + * CombinedQueryComponent#mergeIds} can read {@code _elevate_} from each shard's {@code + * sort_values_i} during distributed merge. + */ + private void prepareCombined(CombinedQueryResponseBuilder crb) throws IOException { + if (crb.responseBuilders.isEmpty()) { + return; + } + for (ResponseBuilder thisRb : crb.responseBuilders) { + prepareElevationComponent(thisRb); + } + // Subqueries get identical elevation treatment, so any one is representative. + ResponseBuilder representative = crb.responseBuilders.getFirst(); + crb.setSortSpec(representative.getSortSpec()); + crb.setFilters(representative.getFilters()); + + if (crb.isDebug() && crb.isDebugQuery()) { + List debugPerSubquery = new ArrayList<>(crb.responseBuilders.size()); + for (ResponseBuilder thisRb : crb.responseBuilders) { + Object queryBoosting = thisRb.getDebugInfo().get(DEBUG_QUERY_BOOSTING); + if (queryBoosting != null) { + debugPerSubquery.add(queryBoosting); + } + } + if (!debugPerSubquery.isEmpty()) { + crb.addDebugInfo(DEBUG_QUERY_BOOSTING, debugPerSubquery); + } + } + } + + private void prepareElevationComponent(ResponseBuilder rb) throws IOException { Elevation elevation = getElevation(rb); if (elevation != null) { setQuery(rb, elevation); @@ -767,7 +807,7 @@ private void addDebugInfo(ResponseBuilder rb, Elevation elevation) { SimpleOrderedMap dbg = new SimpleOrderedMap<>(); dbg.add("q", rb.getQueryString()); dbg.add("match", match); - rb.addDebugInfo("queryBoosting", dbg); + rb.addDebugInfo(DEBUG_QUERY_BOOSTING, dbg); } // --------------------------------------------------------------------------------- diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-combined-query.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-combined-query.xml index b96ff9cd687..35908f42195 100644 --- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-combined-query.xml +++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-combined-query.xml @@ -98,7 +98,18 @@ - + + + elevator + + + + > + string + elevate.xml + + + 2 @@ -159,7 +170,7 @@ - + text diff --git a/solr/core/src/test/org/apache/solr/handler/component/CombinedQuerySolrCloudTest.java b/solr/core/src/test/org/apache/solr/handler/component/CombinedQuerySolrCloudTest.java index 4f5f31d8006..8b8f80014d4 100644 --- a/solr/core/src/test/org/apache/solr/handler/component/CombinedQuerySolrCloudTest.java +++ b/solr/core/src/test/org/apache/solr/handler/component/CombinedQuerySolrCloudTest.java @@ -16,12 +16,15 @@ */ package org.apache.solr.handler.component; +import static org.apache.solr.cloud.AbstractZkTestCase.SOLRHOME; + import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.apache.solr.client.solrj.response.QueryResponse; import org.apache.solr.cloud.AbstractFullDistribZkTestBase; +import org.apache.solr.cloud.ZkTestServer; import org.apache.solr.common.SolrInputDocument; import org.apache.solr.common.params.CommonParams; import org.apache.solr.common.params.ShardParams; @@ -49,6 +52,12 @@ public CombinedQuerySolrCloudTest() { configString = "solrconfig-combined-query.xml"; } + @Override + public void distribSetUp() throws Exception { + super.distribSetUp(); + ZkTestServer.putConfig("conf1", zkServer.getZkClient(), SOLRHOME, "elevate.xml"); + } + @Override protected String getCloudSchemaFile() { return "schema-vector-catchall.xml"; @@ -269,6 +278,48 @@ public void testQueriesWithFacetAndHighlights() throws Exception { rsp.getHighlighting().get("5").get("title").getFirst()); } + /** + * Tests the combined query feature with faceting, highlighting and elevation. + * + * @throws Exception if any unexpected error occurs during the test execution. + */ + @Test + public void testElevatedQueriesWithFacetAndHighlights() throws Exception { + prepareIndexDocs(); + String jsonQuery = + """ + { + "queries": { + "lexical1": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 5^1)"}}, + "lexical2": {"lucene": {"query": "id:(4^1 OR 5^2 OR 7^3 OR 10^2)"}} + }, + "limit": 4, + "fields": ["id", "score", "title"], + "params": { + "combiner": true, + "elevateIds": "6,10", + "combiner.query": ["lexical1", "lexical2"], + "facet": true, + "facet.field": "mod3_idv", + "hl": true, + "hl.fl": "title", + "hl.q": "test doc" + } + }"""; + QueryResponse rsp = query(CommonParams.JSON, jsonQuery, CommonParams.QT, "/search-elevate"); + assertEquals(4, rsp.getResults().size()); + assertFieldValues(rsp.getResults(), id, "6", "10", "7", "2"); + assertEquals("mod3_idv", rsp.getFacetFields().getFirst().getName()); + assertEquals("[1 (3), 0 (2), 2 (2)]", rsp.getFacetFields().getFirst().getValues().toString()); + assertEquals(4, rsp.getHighlighting().size()); + assertEquals( + "title test for doc 6", + rsp.getHighlighting().get("6").get("title").getFirst()); + assertEquals( + "title test for doc 2", + rsp.getHighlighting().get("2").get("title").getFirst()); + } + /** * Tests the combined query feature with faceting, highlighting and collapse. * diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java index bb9105cad30..48bad452fbe 100644 --- a/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java +++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java @@ -282,6 +282,52 @@ public void testQueriesWithFacetAndHighlights() throws Exception { rsp.getHighlighting().get("5").get("title").getFirst()); } + /** + * Tests the combined query feature with faceting, highlighting and elevation with debug. + * + * @throws Exception if any unexpected error occurs during the test execution. + */ + @Test + public void testElevatedQueriesWithFacetAndHighlights() throws Exception { + prepareIndexDocs(); + String jsonQuery = + """ + { + "queries": { + "lexical1": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 1^1)"}}, + "lexical2": {"lucene": {"query": "id:(4^1 OR 1^2 OR 7^3 OR 10^2)"}} + }, + "limit": 4, + "fields": ["id", "score", "title"], + "params": { + "combiner": true, + "elevateIds": "10,6", + "combiner.query": ["lexical1", "lexical2"], + "facet": true, + "facet.field": "mod3_idv", + "hl": true, + "hl.fl": "title", + "hl.q": "test doc", + "debug": "true" + } + }"""; + handle.put("debug", SKIP); + QueryResponse rsp = query(CommonParams.JSON, jsonQuery, CommonParams.QT, "/search-elevate"); + assertEquals(4, rsp.getResults().size()); + assertFieldValues(rsp.getResults(), id, "10", "6", "1", "7"); + assertEquals("mod3_idv", rsp.getFacetFields().getFirst().getName()); + assertEquals("[1 (4), 0 (2), 2 (1)]", rsp.getFacetFields().getFirst().getValues().toString()); + assertEquals(4, rsp.getHighlighting().size()); + assertEquals( + "title test for doc 1", + rsp.getHighlighting().get("1").get("title").getFirst()); + assertEquals( + "title test for doc 6", + rsp.getHighlighting().get("6").get("title").getFirst()); + assertTrue(rsp.getDebugMap().containsKey("queryBoosting")); + assertEquals(2, ((List) rsp.getDebugMap().get("queryBoosting")).size()); + } + /** * @see org.apache.solr.handler.component.CombinedQuerySolrCloudTest#testForcedDistrib() */ From 2e9a1ed54bf82ca6bf3b300abd0e2ece974f0201 Mon Sep 17 00:00:00 2001 From: Sonu Sharma Date: Fri, 29 May 2026 22:54:52 +0530 Subject: [PATCH 2/7] added changelog --- .../SOLR-18271-query-elevation-combined-query.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 changelog/unreleased/SOLR-18271-query-elevation-combined-query.yml diff --git a/changelog/unreleased/SOLR-18271-query-elevation-combined-query.yml b/changelog/unreleased/SOLR-18271-query-elevation-combined-query.yml new file mode 100644 index 00000000000..a2acaa2e623 --- /dev/null +++ b/changelog/unreleased/SOLR-18271-query-elevation-combined-query.yml @@ -0,0 +1,8 @@ +title: Support for using Query Elevation with CombinedQueryComponent (RRF) +type: added +authors: + - name: Sonu Sharma + nick: ercsonusharma +links: + - name: SOLR-18271 + url: https://issues.apache.org/jira/browse/SOLR-18271 From d86e8542aa116bb90d9f64d4dcb1900786419ab6 Mon Sep 17 00:00:00 2001 From: Sonu Sharma Date: Sun, 31 May 2026 20:41:38 +0530 Subject: [PATCH 3/7] fix nightly tests --- .../solr/handler/component/CombinedQuerySolrCloudTest.java | 7 +++++++ .../component/DistributedCombinedQueryComponentTest.java | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/solr/core/src/test/org/apache/solr/handler/component/CombinedQuerySolrCloudTest.java b/solr/core/src/test/org/apache/solr/handler/component/CombinedQuerySolrCloudTest.java index 8b8f80014d4..8baf49b501f 100644 --- a/solr/core/src/test/org/apache/solr/handler/component/CombinedQuerySolrCloudTest.java +++ b/solr/core/src/test/org/apache/solr/handler/component/CombinedQuerySolrCloudTest.java @@ -69,6 +69,11 @@ protected String getCloudSolrConfig() { } private synchronized void prepareIndexDocs() throws Exception { + // Distributed scoring (even with ExactStatsCache) is not bit-identical to single-core + // scoring - some tiny floating point noise. Skip exact value comparison for scores while + // still requiring the fields to be present; doc ordering is asserted already. + handle.put("maxScore", SKIPVAL); + handle.put("score", SKIPVAL); List docs = getSolrDocuments(); del("*:*"); for (SolrInputDocument doc : docs) { @@ -79,6 +84,8 @@ private synchronized void prepareIndexDocs() throws Exception { /** Index all docs to the same shard for co-location (limitation for collapse). */ private synchronized void prepareIndexDocsColocated() throws Exception { + handle.put("maxScore", SKIPVAL); + handle.put("score", SKIPVAL); del("*:*"); List docs = getSolrDocuments(); for (SolrInputDocument doc : docs) { diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java index 48bad452fbe..87a3c92fbf4 100644 --- a/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java +++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java @@ -61,6 +61,11 @@ public static void setUpClass() { * @throws Exception if any error occurs during the indexing process. */ private synchronized void prepareIndexDocs() throws Exception { + // Distributed scoring (even with ExactStatsCache) is not bit-identical to single-core + // scoring - some tiny floating point noise. Skip exact value comparison for scores while + // still requiring the fields to be present; doc ordering is asserted already. + handle.put("maxScore", SKIPVAL); + handle.put("score", SKIPVAL); List docs = new ArrayList<>(); fixShardCount(2); for (int i = 1; i <= NUM_DOCS; i++) { @@ -365,6 +370,8 @@ public void testForcedDistrib() throws Exception { */ @Test public void testCollapseWithCombinedQueryProducesDuplicates() throws Exception { + handle.put("maxScore", SKIPVAL); + handle.put("score", SKIPVAL); del("*:*"); // Index 6 docs where mod3_idv groups docs: {3,6}→0, {1,4}→1, {2,5}→2 From 6787e1c70d06f238cbd17f26a455b9b827d03df4 Mon Sep 17 00:00:00 2001 From: Sonu Sharma Date: Sun, 31 May 2026 21:58:45 +0530 Subject: [PATCH 4/7] score tie breaking fix --- .../component/CombinedQuerySolrCloudTest.java | 31 +++++++---------- ...DistributedCombinedQueryComponentTest.java | 33 ++++++++----------- 2 files changed, 25 insertions(+), 39 deletions(-) diff --git a/solr/core/src/test/org/apache/solr/handler/component/CombinedQuerySolrCloudTest.java b/solr/core/src/test/org/apache/solr/handler/component/CombinedQuerySolrCloudTest.java index 8baf49b501f..d73eee6f1f2 100644 --- a/solr/core/src/test/org/apache/solr/handler/component/CombinedQuerySolrCloudTest.java +++ b/solr/core/src/test/org/apache/solr/handler/component/CombinedQuerySolrCloudTest.java @@ -69,11 +69,6 @@ protected String getCloudSolrConfig() { } private synchronized void prepareIndexDocs() throws Exception { - // Distributed scoring (even with ExactStatsCache) is not bit-identical to single-core - // scoring - some tiny floating point noise. Skip exact value comparison for scores while - // still requiring the fields to be present; doc ordering is asserted already. - handle.put("maxScore", SKIPVAL); - handle.put("score", SKIPVAL); List docs = getSolrDocuments(); del("*:*"); for (SolrInputDocument doc : docs) { @@ -84,8 +79,6 @@ private synchronized void prepareIndexDocs() throws Exception { /** Index all docs to the same shard for co-location (limitation for collapse). */ private synchronized void prepareIndexDocsColocated() throws Exception { - handle.put("maxScore", SKIPVAL); - handle.put("score", SKIPVAL); del("*:*"); List docs = getSolrDocuments(); for (SolrInputDocument doc : docs) { @@ -157,8 +150,8 @@ public void testMultipleLexicalQuery() throws Exception { prepareIndexDocs(); String jsonQuery = "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^2 OR 3^1 OR 6^2 OR 5^1)\"}}," - + "\"lexical2\":{\"lucene\":{\"query\":\"id:(8^1 OR 5^2 OR 7^3 OR 10^2)\"}}}," + + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^4 OR 3^2 OR 6^3 OR 5^1)\"}}," + + "\"lexical2\":{\"lucene\":{\"query\":\"id:(8^1 OR 5^3 OR 7^4 OR 10^2)\"}}}," + "\"limit\":5," + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\",\"lexical2\"]}}"; @@ -177,8 +170,8 @@ public void testMultipleQueryWithSort() throws Exception { prepareIndexDocs(); String jsonQuery = "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^2 OR 3^1 OR 6^2 OR 5^1)\"}}," - + "\"lexical2\":{\"lucene\":{\"query\":\"id:(8^1 OR 5^2 OR 7^3 OR 10^1)\"}}}," + + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^4 OR 3^2 OR 6^3 OR 5^1)\"}}," + + "\"lexical2\":{\"lucene\":{\"query\":\"id:(8^1 OR 5^3 OR 7^4 OR 10^2)\"}}}," + "\"limit\":5,\"sort\":\"mod3_idv desc, score desc\"" + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\",\"lexical2\"]}}"; @@ -199,8 +192,8 @@ public void testHybridQueryWithPagination() throws Exception { query( CommonParams.JSON, "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^2 OR 3^1 OR 6^2 OR 5^1)\"}}," - + "\"lexical2\":{\"lucene\":{\"query\":\"id:(8^1 OR 5^2 OR 7^3 OR 10^2)\"}}}," + + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^4 OR 3^2 OR 6^3 OR 5^1)\"}}," + + "\"lexical2\":{\"lucene\":{\"query\":\"id:(8^1 OR 5^3 OR 7^4 OR 10^2)\"}}}," + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\",\"lexical2\"]}}", CommonParams.QT, @@ -210,8 +203,8 @@ public void testHybridQueryWithPagination() throws Exception { query( CommonParams.JSON, "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^2 OR 3^1 OR 6^2 OR 5^1)\"}}," - + "\"lexical2\":{\"lucene\":{\"query\":\"id:(8^1 OR 5^2 OR 7^3 OR 10^2)\"}}}," + + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^4 OR 3^2 OR 6^3 OR 5^1)\"}}," + + "\"lexical2\":{\"lucene\":{\"query\":\"id:(8^1 OR 5^3 OR 7^4 OR 10^2)\"}}}," + "\"limit\":4," + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\",\"lexical2\"]}}", @@ -222,8 +215,8 @@ public void testHybridQueryWithPagination() throws Exception { query( CommonParams.JSON, "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^2 OR 3^1 OR 6^2 OR 5^1)\"}}," - + "\"lexical2\":{\"lucene\":{\"query\":\"id:(8^1 OR 5^2 OR 7^3 OR 10^2)\"}}}," + + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^4 OR 3^2 OR 6^3 OR 5^1)\"}}," + + "\"lexical2\":{\"lucene\":{\"query\":\"id:(8^1 OR 5^3 OR 7^4 OR 10^2)\"}}}," + "\"limit\":4,\"offset\":3," + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\",\"lexical2\"]}}", @@ -264,8 +257,8 @@ public void testQueriesWithFacetAndHighlights() throws Exception { prepareIndexDocs(); String jsonQuery = "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^2 OR 3^1 OR 6^2 OR 5^1)\"}}," - + "\"lexical2\":{\"lucene\":{\"query\":\"id:(8^1 OR 5^2 OR 7^3 OR 10^2)\"}}}," + + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^4 OR 3^2 OR 6^3 OR 5^1)\"}}," + + "\"lexical2\":{\"lucene\":{\"query\":\"id:(8^1 OR 5^3 OR 7^4 OR 10^2)\"}}}," + "\"limit\":4," + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"facet\":true,\"facet.field\":\"mod3_idv\"," diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java index 87a3c92fbf4..19009396792 100644 --- a/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java +++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java @@ -61,11 +61,6 @@ public static void setUpClass() { * @throws Exception if any error occurs during the indexing process. */ private synchronized void prepareIndexDocs() throws Exception { - // Distributed scoring (even with ExactStatsCache) is not bit-identical to single-core - // scoring - some tiny floating point noise. Skip exact value comparison for scores while - // still requiring the fields to be present; doc ordering is asserted already. - handle.put("maxScore", SKIPVAL); - handle.put("score", SKIPVAL); List docs = new ArrayList<>(); fixShardCount(2); for (int i = 1; i <= NUM_DOCS; i++) { @@ -159,8 +154,8 @@ public void testMultipleLexicalQuery() throws Exception { prepareIndexDocs(); String jsonQuery = "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^2 OR 3^1 OR 6^2 OR 5^1)\"}}," - + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^1 OR 5^2 OR 7^3 OR 10^2)\"}}}," + + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^4 OR 3^2 OR 6^3 OR 5^1)\"}}," + + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^1 OR 5^3 OR 7^4 OR 10^2)\"}}}," + "\"limit\":5," + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\",\"lexical2\"]}}"; @@ -179,8 +174,8 @@ public void testMultipleQueryWithSort() throws Exception { prepareIndexDocs(); String jsonQuery = "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^2 OR 3^1 OR 6^2 OR 5^1)\"}}," - + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^1 OR 5^2 OR 7^3 OR 10^2)\"}}}," + + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^4 OR 3^2 OR 6^3 OR 5^1)\"}}," + + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^1 OR 5^3 OR 7^4 OR 10^2)\"}}}," + "\"limit\":5,\"sort\":\"mod3_idv desc, score desc\"" + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\",\"lexical2\"]}}"; @@ -201,8 +196,8 @@ public void testHybridQueryWithPagination() throws Exception { query( CommonParams.JSON, "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^2 OR 3^1 OR 6^2 OR 5^1)\"}}," - + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^1 OR 5^2 OR 7^3 OR 10^2)\"}}}," + + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^4 OR 3^2 OR 6^3 OR 5^1)\"}}," + + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^1 OR 5^3 OR 7^4 OR 10^2)\"}}}," + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\",\"lexical2\"]}}", CommonParams.QT, @@ -212,8 +207,8 @@ public void testHybridQueryWithPagination() throws Exception { query( CommonParams.JSON, "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^2 OR 3^1 OR 6^2 OR 5^1)\"}}," - + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^1 OR 5^2 OR 7^3 OR 10^2)\"}}}," + + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^4 OR 3^2 OR 6^3 OR 5^1)\"}}," + + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^1 OR 5^3 OR 7^4 OR 10^2)\"}}}," + "\"limit\":4," + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\",\"lexical2\"]}}", @@ -224,8 +219,8 @@ public void testHybridQueryWithPagination() throws Exception { query( CommonParams.JSON, "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^2 OR 3^1 OR 6^2 OR 5^1)\"}}," - + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^1 OR 5^2 OR 7^3 OR 10^2)\"}}}," + + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^4 OR 3^2 OR 6^3 OR 5^1)\"}}," + + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^1 OR 5^3 OR 7^4 OR 10^2)\"}}}," + "\"limit\":4,\"offset\":3," + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\",\"lexical2\"]}}", @@ -245,7 +240,7 @@ public void testQueryWithFaceting() throws Exception { prepareIndexDocs(); String jsonQuery = "{\"queries\":" - + "{\"lexical\":{\"lucene\":{\"query\":\"id:(2^2 OR 3^1 OR 6^2 OR 5^1)\"}}}," + + "{\"lexical\":{\"lucene\":{\"query\":\"id:(2^4 OR 3^2 OR 6^3 OR 5^1)\"}}}," + "\"limit\":3,\"offset\":1" + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"facet\":true,\"facet.field\":\"mod3_idv\",\"facet.mincount\":1," @@ -266,8 +261,8 @@ public void testQueriesWithFacetAndHighlights() throws Exception { prepareIndexDocs(); String jsonQuery = "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^2 OR 3^1 OR 6^2 OR 5^1)\"}}," - + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^1 OR 5^2 OR 7^3 OR 10^2)\"}}}," + + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^4 OR 3^2 OR 6^3 OR 5^1)\"}}," + + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^1 OR 5^3 OR 7^4 OR 10^2)\"}}}," + "\"limit\":4," + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"facet\":true,\"facet.field\":\"mod3_idv\"," @@ -370,8 +365,6 @@ public void testForcedDistrib() throws Exception { */ @Test public void testCollapseWithCombinedQueryProducesDuplicates() throws Exception { - handle.put("maxScore", SKIPVAL); - handle.put("score", SKIPVAL); del("*:*"); // Index 6 docs where mod3_idv groups docs: {3,6}→0, {1,4}→1, {2,5}→2 From 0e3d92d89a8ac5e6650a5d6a0d64587ea004a138 Mon Sep 17 00:00:00 2001 From: Sonu Sharma Date: Sun, 31 May 2026 23:18:22 +0530 Subject: [PATCH 5/7] test modify --- .../handler/component/CombinedQuerySolrCloudTest.java | 8 ++++---- .../component/DistributedCombinedQueryComponentTest.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/solr/core/src/test/org/apache/solr/handler/component/CombinedQuerySolrCloudTest.java b/solr/core/src/test/org/apache/solr/handler/component/CombinedQuerySolrCloudTest.java index d73eee6f1f2..9e38f5e350d 100644 --- a/solr/core/src/test/org/apache/solr/handler/component/CombinedQuerySolrCloudTest.java +++ b/solr/core/src/test/org/apache/solr/handler/component/CombinedQuerySolrCloudTest.java @@ -290,7 +290,7 @@ public void testElevatedQueriesWithFacetAndHighlights() throws Exception { """ { "queries": { - "lexical1": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 5^1)"}}, + "lexical1": {"lucene": {"query": "id:(2^3 OR 3^1 OR 6^2 OR 5^2)"}}, "lexical2": {"lucene": {"query": "id:(4^1 OR 5^2 OR 7^3 OR 10^2)"}} }, "limit": 4, @@ -308,7 +308,7 @@ public void testElevatedQueriesWithFacetAndHighlights() throws Exception { }"""; QueryResponse rsp = query(CommonParams.JSON, jsonQuery, CommonParams.QT, "/search-elevate"); assertEquals(4, rsp.getResults().size()); - assertFieldValues(rsp.getResults(), id, "6", "10", "7", "2"); + assertFieldValues(rsp.getResults(), id, "6", "10", "5", "7"); assertEquals("mod3_idv", rsp.getFacetFields().getFirst().getName()); assertEquals("[1 (3), 0 (2), 2 (2)]", rsp.getFacetFields().getFirst().getValues().toString()); assertEquals(4, rsp.getHighlighting().size()); @@ -316,8 +316,8 @@ public void testElevatedQueriesWithFacetAndHighlights() throws Exception { "title test for doc 6", rsp.getHighlighting().get("6").get("title").getFirst()); assertEquals( - "title test for doc 2", - rsp.getHighlighting().get("2").get("title").getFirst()); + "title test for doc 5", + rsp.getHighlighting().get("5").get("title").getFirst()); } /** diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java index 19009396792..d12b4a33ee9 100644 --- a/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java +++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java @@ -294,7 +294,7 @@ public void testElevatedQueriesWithFacetAndHighlights() throws Exception { """ { "queries": { - "lexical1": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 1^1)"}}, + "lexical1": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 1^2)"}}, "lexical2": {"lucene": {"query": "id:(4^1 OR 1^2 OR 7^3 OR 10^2)"}} }, "limit": 4, From cb14b46f941f892f5635dbcc8392753f8abc96b1 Mon Sep 17 00:00:00 2001 From: Sonu Sharma Date: Sun, 31 May 2026 23:26:27 +0530 Subject: [PATCH 6/7] test modify --- .../solr/handler/component/CombinedQuerySolrCloudTest.java | 4 ++-- .../component/DistributedCombinedQueryComponentTest.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/solr/core/src/test/org/apache/solr/handler/component/CombinedQuerySolrCloudTest.java b/solr/core/src/test/org/apache/solr/handler/component/CombinedQuerySolrCloudTest.java index 9e38f5e350d..ab166793cf8 100644 --- a/solr/core/src/test/org/apache/solr/handler/component/CombinedQuerySolrCloudTest.java +++ b/solr/core/src/test/org/apache/solr/handler/component/CombinedQuerySolrCloudTest.java @@ -313,8 +313,8 @@ public void testElevatedQueriesWithFacetAndHighlights() throws Exception { assertEquals("[1 (3), 0 (2), 2 (2)]", rsp.getFacetFields().getFirst().getValues().toString()); assertEquals(4, rsp.getHighlighting().size()); assertEquals( - "title test for doc 6", - rsp.getHighlighting().get("6").get("title").getFirst()); + "title test for doc 10", + rsp.getHighlighting().get("10").get("title").getFirst()); assertEquals( "title test for doc 5", rsp.getHighlighting().get("5").get("title").getFirst()); diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java index d12b4a33ee9..3ade8087863 100644 --- a/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java +++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java @@ -294,7 +294,7 @@ public void testElevatedQueriesWithFacetAndHighlights() throws Exception { """ { "queries": { - "lexical1": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 1^2)"}}, + "lexical1": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 1^3)"}}, "lexical2": {"lucene": {"query": "id:(4^1 OR 1^2 OR 7^3 OR 10^2)"}} }, "limit": 4, From f213b0052f34409283a93caa535f9175e82dd93f Mon Sep 17 00:00:00 2001 From: Sonu Sharma Date: Mon, 1 Jun 2026 16:58:10 +0530 Subject: [PATCH 7/7] constant scoring: test fix --- .../component/CombinedQuerySolrCloudTest.java | 36 +++++++++---------- ...DistributedCombinedQueryComponentTest.java | 32 ++++++++--------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/solr/core/src/test/org/apache/solr/handler/component/CombinedQuerySolrCloudTest.java b/solr/core/src/test/org/apache/solr/handler/component/CombinedQuerySolrCloudTest.java index ab166793cf8..39a7e69e23f 100644 --- a/solr/core/src/test/org/apache/solr/handler/component/CombinedQuerySolrCloudTest.java +++ b/solr/core/src/test/org/apache/solr/handler/component/CombinedQuerySolrCloudTest.java @@ -130,7 +130,7 @@ public void testSingleLexicalQuery() throws Exception { query( CommonParams.JSON, "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:2^10\"}}}," + + "{\"lexical1\":{\"lucene\":{\"query\":\"id:2^=10\"}}}," + "\"limit\":5," + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\"]}}", @@ -150,8 +150,8 @@ public void testMultipleLexicalQuery() throws Exception { prepareIndexDocs(); String jsonQuery = "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^4 OR 3^2 OR 6^3 OR 5^1)\"}}," - + "\"lexical2\":{\"lucene\":{\"query\":\"id:(8^1 OR 5^3 OR 7^4 OR 10^2)\"}}}," + + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^=4 OR 3^=2 OR 6^=3 OR 5^=1)\"}}," + + "\"lexical2\":{\"lucene\":{\"query\":\"id:(8^=1 OR 5^=3 OR 7^=4 OR 10^=2)\"}}}," + "\"limit\":5," + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\",\"lexical2\"]}}"; @@ -170,8 +170,8 @@ public void testMultipleQueryWithSort() throws Exception { prepareIndexDocs(); String jsonQuery = "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^4 OR 3^2 OR 6^3 OR 5^1)\"}}," - + "\"lexical2\":{\"lucene\":{\"query\":\"id:(8^1 OR 5^3 OR 7^4 OR 10^2)\"}}}," + + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^=4 OR 3^=2 OR 6^=3 OR 5^=1)\"}}," + + "\"lexical2\":{\"lucene\":{\"query\":\"id:(8^=1 OR 5^=3 OR 7^=4 OR 10^=2)\"}}}," + "\"limit\":5,\"sort\":\"mod3_idv desc, score desc\"" + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\",\"lexical2\"]}}"; @@ -192,8 +192,8 @@ public void testHybridQueryWithPagination() throws Exception { query( CommonParams.JSON, "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^4 OR 3^2 OR 6^3 OR 5^1)\"}}," - + "\"lexical2\":{\"lucene\":{\"query\":\"id:(8^1 OR 5^3 OR 7^4 OR 10^2)\"}}}," + + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^=4 OR 3^=2 OR 6^=3 OR 5^=1)\"}}," + + "\"lexical2\":{\"lucene\":{\"query\":\"id:(8^=1 OR 5^=3 OR 7^=4 OR 10^=2)\"}}}," + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\",\"lexical2\"]}}", CommonParams.QT, @@ -203,8 +203,8 @@ public void testHybridQueryWithPagination() throws Exception { query( CommonParams.JSON, "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^4 OR 3^2 OR 6^3 OR 5^1)\"}}," - + "\"lexical2\":{\"lucene\":{\"query\":\"id:(8^1 OR 5^3 OR 7^4 OR 10^2)\"}}}," + + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^=4 OR 3^=2 OR 6^=3 OR 5^=1)\"}}," + + "\"lexical2\":{\"lucene\":{\"query\":\"id:(8^=1 OR 5^=3 OR 7^=4 OR 10^=2)\"}}}," + "\"limit\":4," + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\",\"lexical2\"]}}", @@ -215,8 +215,8 @@ public void testHybridQueryWithPagination() throws Exception { query( CommonParams.JSON, "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^4 OR 3^2 OR 6^3 OR 5^1)\"}}," - + "\"lexical2\":{\"lucene\":{\"query\":\"id:(8^1 OR 5^3 OR 7^4 OR 10^2)\"}}}," + + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^=4 OR 3^=2 OR 6^=3 OR 5^=1)\"}}," + + "\"lexical2\":{\"lucene\":{\"query\":\"id:(8^=1 OR 5^=3 OR 7^=4 OR 10^=2)\"}}}," + "\"limit\":4,\"offset\":3," + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\",\"lexical2\"]}}", @@ -236,7 +236,7 @@ public void testQueryWithFaceting() throws Exception { prepareIndexDocs(); String jsonQuery = "{\"queries\":" - + "{\"lexical\":{\"lucene\":{\"query\":\"id:(2^2 OR 3^1 OR 6^2 OR 5^1)\"}}}," + + "{\"lexical\":{\"lucene\":{\"query\":\"id:(2^=2 OR 3^=1 OR 6^=2 OR 5^=1)\"}}}," + "\"limit\":3,\"offset\":1" + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"facet\":true,\"facet.field\":\"mod3_idv\",\"facet.mincount\":1," @@ -257,8 +257,8 @@ public void testQueriesWithFacetAndHighlights() throws Exception { prepareIndexDocs(); String jsonQuery = "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^4 OR 3^2 OR 6^3 OR 5^1)\"}}," - + "\"lexical2\":{\"lucene\":{\"query\":\"id:(8^1 OR 5^3 OR 7^4 OR 10^2)\"}}}," + + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^=4 OR 3^=2 OR 6^=3 OR 5^=1)\"}}," + + "\"lexical2\":{\"lucene\":{\"query\":\"id:(8^=1 OR 5^=3 OR 7^=4 OR 10^=2)\"}}}," + "\"limit\":4," + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"facet\":true,\"facet.field\":\"mod3_idv\"," @@ -290,8 +290,8 @@ public void testElevatedQueriesWithFacetAndHighlights() throws Exception { """ { "queries": { - "lexical1": {"lucene": {"query": "id:(2^3 OR 3^1 OR 6^2 OR 5^2)"}}, - "lexical2": {"lucene": {"query": "id:(4^1 OR 5^2 OR 7^3 OR 10^2)"}} + "lexical1": {"lucene": {"query": "id:(2^=3 OR 3^=1 OR 6^=2 OR 5^=2)"}}, + "lexical2": {"lucene": {"query": "id:(4^=1 OR 5^=2 OR 7^=3 OR 10^=2)"}} }, "limit": 4, "fields": ["id", "score", "title"], @@ -335,12 +335,12 @@ public void testQueriesWithFacetAndHighlightsCollapse() throws Exception { "queries": { "lexical1": { "lucene": { - "query": "id:(CO!2^3 OR CO!3^1 OR CO!6^2 OR CO!5^1)" + "query": "id:(CO!2^=3 OR CO!3^=1 OR CO!6^=2 OR CO!5^=1)" } }, "lexical2": { "lucene": { - "query": "id:(CO!8^1 OR CO!5^2 OR CO!7^3 OR CO!10^2)" + "query": "id:(CO!8^=1 OR CO!5^=2 OR CO!7^=3 OR CO!10^=2)" } } }, diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java index 3ade8087863..9a11751b141 100644 --- a/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java +++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java @@ -122,7 +122,7 @@ public void testSingleLexicalQuery() throws Exception { query( CommonParams.JSON, "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:2^10\"}}}," + + "{\"lexical1\":{\"lucene\":{\"query\":\"id:2^=10\"}}}," + "\"limit\":5," + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\"]}}", @@ -154,8 +154,8 @@ public void testMultipleLexicalQuery() throws Exception { prepareIndexDocs(); String jsonQuery = "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^4 OR 3^2 OR 6^3 OR 5^1)\"}}," - + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^1 OR 5^3 OR 7^4 OR 10^2)\"}}}," + + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^=4 OR 3^=2 OR 6^=3 OR 5^=1)\"}}," + + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^=1 OR 5^=3 OR 7^=4 OR 10^=2)\"}}}," + "\"limit\":5," + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\",\"lexical2\"]}}"; @@ -174,8 +174,8 @@ public void testMultipleQueryWithSort() throws Exception { prepareIndexDocs(); String jsonQuery = "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^4 OR 3^2 OR 6^3 OR 5^1)\"}}," - + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^1 OR 5^3 OR 7^4 OR 10^2)\"}}}," + + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^=4 OR 3^=2 OR 6^=3 OR 5^=1)\"}}," + + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^=1 OR 5^=3 OR 7^=4 OR 10^=2)\"}}}," + "\"limit\":5,\"sort\":\"mod3_idv desc, score desc\"" + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\",\"lexical2\"]}}"; @@ -196,8 +196,8 @@ public void testHybridQueryWithPagination() throws Exception { query( CommonParams.JSON, "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^4 OR 3^2 OR 6^3 OR 5^1)\"}}," - + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^1 OR 5^3 OR 7^4 OR 10^2)\"}}}," + + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^=4 OR 3^=2 OR 6^=3 OR 5^=1)\"}}," + + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^=1 OR 5^=3 OR 7^=4 OR 10^=2)\"}}}," + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\",\"lexical2\"]}}", CommonParams.QT, @@ -207,8 +207,8 @@ public void testHybridQueryWithPagination() throws Exception { query( CommonParams.JSON, "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^4 OR 3^2 OR 6^3 OR 5^1)\"}}," - + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^1 OR 5^3 OR 7^4 OR 10^2)\"}}}," + + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^=4 OR 3^=2 OR 6^=3 OR 5^=1)\"}}," + + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^=1 OR 5^=3 OR 7^=4 OR 10^=2)\"}}}," + "\"limit\":4," + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\",\"lexical2\"]}}", @@ -219,8 +219,8 @@ public void testHybridQueryWithPagination() throws Exception { query( CommonParams.JSON, "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^4 OR 3^2 OR 6^3 OR 5^1)\"}}," - + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^1 OR 5^3 OR 7^4 OR 10^2)\"}}}," + + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^=4 OR 3^=2 OR 6^=3 OR 5^=1)\"}}," + + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^=1 OR 5^=3 OR 7^=4 OR 10^=2)\"}}}," + "\"limit\":4,\"offset\":3," + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\",\"lexical2\"]}}", @@ -240,7 +240,7 @@ public void testQueryWithFaceting() throws Exception { prepareIndexDocs(); String jsonQuery = "{\"queries\":" - + "{\"lexical\":{\"lucene\":{\"query\":\"id:(2^4 OR 3^2 OR 6^3 OR 5^1)\"}}}," + + "{\"lexical\":{\"lucene\":{\"query\":\"id:(2^=4 OR 3^=2 OR 6^=3 OR 5^=1)\"}}}," + "\"limit\":3,\"offset\":1" + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"facet\":true,\"facet.field\":\"mod3_idv\",\"facet.mincount\":1," @@ -261,8 +261,8 @@ public void testQueriesWithFacetAndHighlights() throws Exception { prepareIndexDocs(); String jsonQuery = "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^4 OR 3^2 OR 6^3 OR 5^1)\"}}," - + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^1 OR 5^3 OR 7^4 OR 10^2)\"}}}," + + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^=4 OR 3^=2 OR 6^=3 OR 5^=1)\"}}," + + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^=1 OR 5^=3 OR 7^=4 OR 10^=2)\"}}}," + "\"limit\":4," + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"facet\":true,\"facet.field\":\"mod3_idv\"," @@ -294,8 +294,8 @@ public void testElevatedQueriesWithFacetAndHighlights() throws Exception { """ { "queries": { - "lexical1": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 1^3)"}}, - "lexical2": {"lucene": {"query": "id:(4^1 OR 1^2 OR 7^3 OR 10^2)"}} + "lexical1": {"lucene": {"query": "id:(2^=2 OR 3^=1 OR 6^=2 OR 1^=3)"}}, + "lexical2": {"lucene": {"query": "id:(4^=1 OR 1^=2 OR 7^=3 OR 10^=2)"}} }, "limit": 4, "fields": ["id", "score", "title"],