Package org.codelibs.fess.helper
Class KeyMatchHelper
java.lang.Object
org.codelibs.fess.helper.AbstractConfigHelper
org.codelibs.fess.helper.KeyMatchHelper
KeyMatchHelper is a helper class for KeyMatch feature.
It manages KeyMatch instances and provides methods to build queries for boosting documents.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<String, Map<String, List<org.codelibs.core.misc.Tuple3<String, org.opensearch.index.query.QueryBuilder, org.opensearch.index.query.functionscore.ScoreFunctionBuilder<?>>>>> A map containing query information for KeyMatch.Fields inherited from class org.codelibs.fess.helper.AbstractConfigHelper
reloadInterval -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildQuery(List<String> keywordList, List<org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder> list) Builds a query for boosting documents based on the keyword list.List<org.codelibs.fess.opensearch.config.exentity.KeyMatch> Returns a list of available KeyMatch instances.getBoostedDocumentList(org.codelibs.fess.opensearch.config.exentity.KeyMatch keyMatch) Retrieves a list of boosted documents for the specified KeyMatch.getDocumentList(org.codelibs.fess.opensearch.config.exentity.KeyMatch keyMatch) Retrieves a list of documents based on the KeyMatch query.protected Map<String, List<org.codelibs.core.misc.Tuple3<String, org.opensearch.index.query.QueryBuilder, org.opensearch.index.query.functionscore.ScoreFunctionBuilder<?>>>> getQueryMap(String key) Returns a query map for the specified virtual host.voidinit()Initializes the helper.intload()Loads KeyMatch settings from the database and builds a query map.Methods inherited from class org.codelibs.fess.helper.AbstractConfigHelper
setReloadInterval, update, waitForNext
-
Field Details
-
keyMatchQueryMap
protected volatile Map<String,Map<String, keyMatchQueryMapList<org.codelibs.core.misc.Tuple3<String, org.opensearch.index.query.QueryBuilder, org.opensearch.index.query.functionscore.ScoreFunctionBuilder<?>>>>> A map containing query information for KeyMatch. The key is a virtual host, and the value is a map of terms and boost information.
-
-
Constructor Details
-
KeyMatchHelper
public KeyMatchHelper()Default constructor.
-
-
Method Details
-
init
@PostConstruct public void init()Initializes the helper. It loads KeyMatch settings from the database. -
getAvailableKeyMatchList
Returns a list of available KeyMatch instances.- Returns:
- A list of KeyMatch instances.
-
load
public int load()Loads KeyMatch settings from the database and builds a query map.- Specified by:
loadin classAbstractConfigHelper- Returns:
- The number of loaded KeyMatch settings.
-
getDocumentList
protected List<Map<String,Object>> getDocumentList(org.codelibs.fess.opensearch.config.exentity.KeyMatch keyMatch) Retrieves a list of documents based on the KeyMatch query.- Parameters:
keyMatch- The KeyMatch instance.- Returns:
- A list of documents.
-
getQueryMap
protected Map<String,List<org.codelibs.core.misc.Tuple3<String, getQueryMaporg.opensearch.index.query.QueryBuilder, org.opensearch.index.query.functionscore.ScoreFunctionBuilder<?>>>> (String key) Returns a query map for the specified virtual host.- Parameters:
key- The virtual host key.- Returns:
- A map of terms and boost information.
-
buildQuery
public void buildQuery(List<String> keywordList, List<org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder> list) Builds a query for boosting documents based on the keyword list.- Parameters:
keywordList- The list of keywords.list- The list of filter function builders to add to.
-
getBoostedDocumentList
public List<Map<String,Object>> getBoostedDocumentList(org.codelibs.fess.opensearch.config.exentity.KeyMatch keyMatch) Retrieves a list of boosted documents for the specified KeyMatch.- Parameters:
keyMatch- The KeyMatch instance.- Returns:
- A list of boosted documents.
-