janhoy commented on code in PR #4495:
URL: https://github.com/apache/solr/pull/4495#discussion_r3341525807
##########
solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java:
##########
@@ -145,130 +123,119 @@ protected String getShardsString() {
}
/**
- * Tests multiple lexical queries using the distributed solr client.
+ * Tests all combined query variants (single lexical, multiple lexical,
sort, pagination,
+ * faceting, facet+highlighting) against the same 10-document index.
*
* @throws Exception if any error occurs during the test execution
*/
@Test
- public void testMultipleLexicalQuery() throws Exception {
+ public void testCombinedQueries() 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\":5,"
- + "\"fields\":[\"id\",\"score\",\"title\"],"
- +
"\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\",\"lexical2\"]}}";
- QueryResponse rsp = query(CommonParams.JSON, jsonQuery, CommonParams.QT,
"/search");
- assertEquals(5, rsp.getResults().size());
- assertFieldValues(rsp.getResults(), id, "5", "7", "2", "6", "3");
- }
- /**
- * Test multiple query execution with sort.
- *
- * @throws Exception the exception
- */
- @Test
- 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)\"}}},"
- + "\"limit\":5,\"sort\":\"mod3_idv desc, score desc\""
- + "\"fields\":[\"id\",\"score\",\"title\"],"
- +
"\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\",\"lexical2\"]}}";
- QueryResponse rsp = query(CommonParams.JSON, jsonQuery, CommonParams.QT,
"/search");
- assertEquals(5, rsp.getResults().size());
- assertFieldValues(rsp.getResults(), id, "5", "2", "7", "10", "4");
- }
-
- /**
- * Tests the hybrid query functionality of the system with various setting
of pagination.
- *
- * @throws Exception if any unexpected error occurs during the test
execution.
- */
- @Test
- public void testHybridQueryWithPagination() throws Exception {
- prepareIndexDocs();
+ // single lexical query
QueryResponse rsp =
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)\"}}},"
- + "\"fields\":[\"id\",\"score\",\"title\"],"
- +
"\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\",\"lexical2\"]}}",
+ """
Review Comment:
I like the idea of a swiping modernization for large complex strings.
And we could also do a swiping change to identify candidates for
`class`->`record`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]