Skip to content

Commit

Permalink
Fix compilation in the rescore plugin
Browse files Browse the repository at this point in the history
Add source fallback operation when looking up a the factor field added in elastic#88735

Resolves elastic#88985
  • Loading branch information
arteam committed Aug 1, 2022
1 parent ad2dc83 commit d3ed689
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.elasticsearch.index.fielddata.SortedNumericDoubleValues;
import org.elasticsearch.index.query.QueryRewriteContext;
import org.elasticsearch.index.query.SearchExecutionContext;
import org.elasticsearch.index.mapper.MappedFieldType;
import org.elasticsearch.search.rescore.RescoreContext;
import org.elasticsearch.search.rescore.Rescorer;
import org.elasticsearch.search.rescore.RescorerBuilder;
Expand Down Expand Up @@ -99,7 +100,8 @@ public static ExampleRescoreBuilder fromXContent(XContentParser parser) {
@Override
public RescoreContext innerBuildContext(int windowSize, SearchExecutionContext context) throws IOException {
IndexFieldData<?> factorFieldData =
this.factorField == null ? null : context.getForField(context.getFieldType(this.factorField));
this.factorField == null ? null : context.getForField(context.getFieldType(this.factorField),
MappedFieldType.FielddataOperation.SEARCH);
return new ExampleRescoreContext(windowSize, factor, factorFieldData);
}

Expand Down

0 comments on commit d3ed689

Please sign in to comment.