Skip to content

Commit d86d16b

Browse files
committed
Readability.
1 parent 5e39eaa commit d86d16b

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/LogicalPlanBuilder.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,9 @@ private UnresolvedAttribute visitRerankScoreAttribute(String optionName, EsqlBas
790790
throw new ParsingException(source(ctx), "Parameter [{}] is null or undefined", optionName);
791791
}
792792

793-
Expression optionValue = ctx.identifier() != null ? Literal.keyword(source(ctx.identifier()), visitIdentifier(ctx.identifier())) : expression(ctx.constant());
793+
Expression optionValue = ctx.identifier() != null
794+
? Literal.keyword(source(ctx.identifier()), visitIdentifier(ctx.identifier()))
795+
: expression(ctx.constant());
794796

795797
if (optionValue instanceof UnresolvedAttribute scoreAttribute) {
796798
return scoreAttribute;

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/inference/Rerank.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import org.elasticsearch.xpack.esql.core.expression.UnresolvedAttribute;
2525
import org.elasticsearch.xpack.esql.core.tree.NodeInfo;
2626
import org.elasticsearch.xpack.esql.core.tree.Source;
27-
import org.elasticsearch.xpack.esql.core.type.DataType;
2827
import org.elasticsearch.xpack.esql.io.stream.PlanStreamInput;
2928
import org.elasticsearch.xpack.esql.plan.logical.LogicalPlan;
3029
import org.elasticsearch.xpack.esql.plan.logical.UnaryPlan;

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/planner/LocalExecutionPlanner.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,13 @@ private PhysicalOperation planRerank(RerankExec rerank, LocalExecutionPlannerCon
620620

621621
EvalOperator.ExpressionEvaluator.Factory rowEncoderFactory;
622622
if (rerank.rerankFields().size() > 1) {
623+
// If there is more than one field used for reranking we are encoded the input in a YAML doc, using field names as key.
624+
// The input value will looks like
625+
// text_field: foo bar
626+
// multivalue_text_field:
627+
// - value 1
628+
// - value 2
629+
// integer_field: 132
623630
Map<ColumnInfoImpl, EvalOperator.ExpressionEvaluator.Factory> rerankFieldsEvaluatorSuppliers = Maps
624631
.newLinkedHashMapWithExpectedSize(rerank.rerankFields().size());
625632

0 commit comments

Comments
 (0)