cpoerschke commented on code in PR #1324:
URL: https://github.com/apache/solr/pull/1324#discussion_r1095579544
##########
solr/core/src/java/org/apache/solr/search/ReRankQParserPlugin.java:
##########
@@ -72,25 +74,33 @@ public Query parse() throws SyntaxError {
double reRankWeight = localParams.getDouble(RERANK_WEIGHT,
RERANK_WEIGHT_DEFAULT);
- return new ReRankQuery(reRankQuery, reRankDocs, reRankWeight);
+ String reRankOperator = localParams.get(RERANK_OPERATOR, "add");
+
+ return new ReRankQuery(reRankQuery, reRankDocs, reRankWeight,
reRankOperator);
}
}
private static final class ReRankQueryRescorer extends QueryRescorer {
final double reRankWeight;
+ final String reRankOperator;
Review Comment:
minor: wondering about use of `String` vs. enum (which would also take care
of handling of typos e.g. `reRankOperator=multi` would throw an exception
rather than be silently treated as `add`)
##########
solr/core/src/java/org/apache/solr/search/ReRankQParserPlugin.java:
##########
@@ -99,6 +109,7 @@ protected float combine(
private static final class ReRankQuery extends AbstractReRankQuery {
private final Query reRankQuery;
private final double reRankWeight;
+ private final String reRankOperator;
@Override
public int hashCode() {
Review Comment:
minor: should we also consider the `reRankOperator` here?
##########
solr/solr-ref-guide/modules/query-guide/pages/query-re-ranking.adoc:
##########
@@ -67,7 +67,7 @@ This number will be treated as a minimum, and may be
increased internally automa
|Optional |Default: `2.0`
|===
+
-A multiplicative factor that will be applied to the score from the reRankQuery
for each of the top matching documents, before that score is added to the
original score.
+A multiplicative factor that will be applied to the score from the reRankQuery
for each of the top matching documents, before that score is combined with the
original score.
In the example below, the top 1000 documents matching the query "greetings"
will be re-ranked using the query "(hi hello hey hiya)".
The resulting scores for each of those 1000 documents will be 3 times their
score from the "(hi hello hey hiya)", plus the score from the original
"greetings" query:
Review Comment:
subjective: perhaps an additional example could be added where _"... plus
the score ..."_ then is _"... times the score ..."_
--
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]