Package org.codelibs.fess.score
Class ScoreBooster
java.lang.Object
org.codelibs.fess.score.ScoreBooster
This class is a base class for score boosters.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.opensearch.action.bulk.BulkRequestBuilderThe bulk request builder.A function to find document IDs.protected intThe priority of this score booster.protected intThe request cache size.A function to handle requests.protected StringThe request timeout.protected StringThe script code.protected StringThe script language. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.opensearch.action.update.UpdateRequestBuilderCreates an update request builder.protected voidenable()Enables this score booster.protected voidflush()Flushes the bulk request builder.intGets the priority of this score booster.abstract longprocess()Processes the score boosting.voidsetPriority(int priority) Sets the priority of this score booster.voidsetRequestCacheSize(int requestCacheSize) Sets the request cache size.voidsetRequestTimeout(String bulkRequestTimeout) Sets the request timeout.voidsetScriptCode(String scriptCode) Sets the script code.voidsetScriptLang(String scriptLang) Sets the script language.protected longupdateScore(Map<String, Object> params) Updates the score of documents.
-
Field Details
-
bulkRequestBuilder
protected org.opensearch.action.bulk.BulkRequestBuilder bulkRequestBuilderThe bulk request builder. -
priority
protected int priorityThe priority of this score booster. -
requestTimeout
The request timeout. -
requestCacheSize
protected int requestCacheSizeThe request cache size. -
scriptLang
The script language. -
scriptCode
The script code. -
idFinder
A function to find document IDs. -
requestHandler
A function to handle requests.
-
-
Constructor Details
-
ScoreBooster
public ScoreBooster()Constructor.
-
-
Method Details
-
process
public abstract long process()Processes the score boosting.- Returns:
- The number of processed documents.
-
enable
protected void enable()Enables this score booster. -
updateScore
Updates the score of documents.- Parameters:
params- The parameters for the update.- Returns:
- The number of updated documents.
-
createUpdateRequestBuilder
protected org.opensearch.action.update.UpdateRequestBuilder createUpdateRequestBuilder()Creates an update request builder.- Returns:
- The update request builder.
-
flush
protected void flush()Flushes the bulk request builder. -
getPriority
public int getPriority()Gets the priority of this score booster.- Returns:
- The priority.
-
setPriority
public void setPriority(int priority) Sets the priority of this score booster.- Parameters:
priority- The priority.
-
setRequestTimeout
Sets the request timeout.- Parameters:
bulkRequestTimeout- The request timeout.
-
setRequestCacheSize
public void setRequestCacheSize(int requestCacheSize) Sets the request cache size.- Parameters:
requestCacheSize- The request cache size.
-
setScriptLang
Sets the script language.- Parameters:
scriptLang- The script language.
-
setScriptCode
Sets the script code.- Parameters:
scriptCode- The script code.
-