You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: solr/solr-ref-guide/modules/query-guide/pages/json-combined-query-dsl.adoc
+68-24Lines changed: 68 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,42 @@ It is extending JSON Query DSL ultimately enabling Hybrid Search.
25
25
This feature is currently unsupported for grouping and Cursors.
26
26
====
27
27
28
+
[IMPORTANT]
29
+
====
30
+
This feature works in both Standalone and SolrCloud modes and always performs distributed search execution.
31
+
In Standalone (user-managed) mode, shard URLs must be explicitly allow-listed using the *allowUrls* parameter, otherwise Solr returns HTTP 403. For example:
The Search Handler also accepts parameters as below:
110
+
== Combiner Algorithm Plugin
85
111
86
-
`maxCombinerQueries`::
87
-
This parameter can be set to put upper limit check on the maximum number of queries can be executed defined in `combiner.query`.
88
-
It defaults to `5` if not set.
112
+
As mentioned xref:json-combined-query-dsl.adoc#query-dsl-structure[above], custom algorithms can be configured to combine the results across multiple queries using a https://solr.apache.org/guide/solr/latest/configuration-guide/solr-plugins.html[Solr plugin].
89
113
90
-
=== Combiner Algorithm Plugin
114
+
The class to implement the custom logic has to extend `org.apache.solr.handler.component.combine.QueryAndResponseCombiner`, which is an abstract base class that provides a framework for implementing various algorithms used to merge ranked lists and shard documents.
91
115
92
-
As mentioned xref:json-combined-query-dsl.adoc#query-dsl-structure[above], custom algorithms can be configured to combine the results across multiple queries.
93
-
The Combined Query Search Handler definition takes parameter `combiners` where a custom class can be used to define the algorithm by giving a name and the parameters required.
116
+
The Combined Query Component definition takes the `combiners` parameter, where the custom class can be declared by specifying a name and the custom parameters required by the custom algorithm.
Then, when executing the combined query, the only thing that changes in the JSON query payload is the value specified in the `combiner.algorithm` parameter:
133
+
134
+
```
135
+
...
136
+
"params": {
137
+
"combiner": true,
138
+
"combiner.query": ["lexical1", "vector"],
139
+
"combiner.algorithm": "customAlgorithm"
140
+
}
141
+
...
142
+
```
143
+
144
+
In this case, `customAlgorithm` is specified which is the name defined in the configuration; the RRF-specific parameters do not need to be provided.
145
+
146
+
== Additional Resources
147
+
148
+
Blog posts:
149
+
150
+
* https://sease.io/2026/03/hybrid-search-with-reciprocal-rank-fusion-in-apache-solr.html[Hybrid Search with Reciprocal Rank Fusion in Apache Solr]
151
+
* https://sease.io/2026/03/hybrid-search-using-a-custom-algorithm-in-apache-solr.html[Hybrid Search using a Custom Algorithm in Apache Solr]
0 commit comments