Module org.elasticsearch.server
Package org.elasticsearch.search.rescore
Class RescorerBuilder<RB extends RescorerBuilder<RB>>
java.lang.Object
org.elasticsearch.search.rescore.RescorerBuilder<RB>
- All Implemented Interfaces:
NamedWriteable,VersionedNamedWriteable,Writeable,Rewriteable<RescorerBuilder<RB>>,ToXContent,ToXContentObject
- Direct Known Subclasses:
QueryRescorerBuilder
public abstract class RescorerBuilder<RB extends RescorerBuilder<RB>>
extends Object
implements VersionedNamedWriteable, ToXContentObject, Rewriteable<RescorerBuilder<RB>>
The abstract base builder for instances of
RescorerBuilder.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsFields inherited from interface org.elasticsearch.index.query.Rewriteable
MAX_REWRITE_ROUNDSFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsModifierConstructorDescriptionConstruct an empty RescoreBuilder.protectedRead from a stream. -
Method Summary
Modifier and TypeMethodDescriptionfinal RescoreContextbuildContext(SearchExecutionContext context) Build the RescoreContext that will be used to actually execute the rescore against a particular shard.protected abstract voiddoWriteTo(StreamOutput out) protected abstract voiddoXContent(XContentBuilder builder, ToXContent.Params params) booleaninthashCode()protected abstract RescoreContextinnerBuildContext(int windowSize, SearchExecutionContext context) Extensions override this to build the context that they need for rescoring.protected booleanIndicate if the window_size is a required parameter for the rescorer.static RescorerBuilder<?> parseFromXContent(XContentParser parser, Consumer<String> rescorerNameConsumer) toString()toXContent(XContentBuilder builder, ToXContent.Params params) validate(SearchSourceBuilder source, ActionRequestValidationException validationException) windowSize(int windowSize) final voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.index.query.Rewriteable
rewriteMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragmentMethods inherited from interface org.elasticsearch.common.io.stream.VersionedNamedWriteable
getMinimalSupportedVersion, getWriteableName
-
Field Details
-
DEFAULT_WINDOW_SIZE
public static final int DEFAULT_WINDOW_SIZE- See Also:
-
windowSize
-
WINDOW_SIZE_FIELD
-
-
Constructor Details
-
RescorerBuilder
public RescorerBuilder()Construct an empty RescoreBuilder. -
RescorerBuilder
Read from a stream.- Throws:
IOException
-
-
Method Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
doWriteTo
- Throws:
IOException
-
windowSize
-
windowSize
-
parseFromXContent
public static RescorerBuilder<?> parseFromXContent(XContentParser parser, Consumer<String> rescorerNameConsumer) throws IOException - Throws:
IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
validate
public ActionRequestValidationException validate(SearchSourceBuilder source, ActionRequestValidationException validationException) -
doXContent
protected abstract void doXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Throws:
IOException
-
isWindowSizeRequired
protected boolean isWindowSizeRequired()Indicate if the window_size is a required parameter for the rescorer. -
buildContext
Build the RescoreContext that will be used to actually execute the rescore against a particular shard.- Throws:
IOException
-
innerBuildContext
protected abstract RescoreContext innerBuildContext(int windowSize, SearchExecutionContext context) throws IOException Extensions override this to build the context that they need for rescoring.- Throws:
IOException
-
hashCode
public int hashCode() -
equals
-
toString
-