Package sk.iway.iwcm.rag.service
Class RagSettingsService
java.lang.Object
sk.iway.iwcm.rag.service.RagSettingsService
Resolves RAG settings from global constants with optional per-component
overrides stored in
PageParams. Empty or "auto" values keep the
global configuration so existing search apps keep their default behavior.-
Method Summary
Modifier and TypeMethodDescriptionstatic intgetHybridChunkFetchMultiplier(PageParams pageParams) static doublegetHybridFallbackTopSimilarity(PageParams pageParams) static booleangetHybridFtsUseIlikeFallback(PageParams pageParams) Resolves whether full-text retrieval may fall back to a database-specific text-pattern search.static doublegetHybridFtsWeight(PageParams pageParams) static intgetHybridRrfK(PageParams pageParams) static StringgetHybridSearchMode(PageParams pageParams) Resolves the hybrid retrieval mode, using global configuration for empty or automatic component values.static intgetHybridShortQueryMaxChars(PageParams pageParams) static intgetHybridShortQueryMaxTerms(PageParams pageParams) static doublegetHybridVectorWeight(PageParams pageParams) static intgetRagAnswerMaxBlocks(PageParams pageParams) static intgetRagAnswerMaxCharacters(PageParams pageParams) static intgetRagAnswerMaxChunkGap(PageParams pageParams) static intgetRagAnswerMaxMergedBlockCharacters(PageParams pageParams) static doublegetRagAnswerMinSimilarity(PageParams pageParams) static intgetRagAnswerTopK(PageParams pageParams) static doubleResolves the text-match weight, clamping finite values and replacing invalid values with the default.static intgetSemanticMinimumResults(PageParams pageParams) static doublegetSemanticMinimumSimilarity(PageParams pageParams) static booleanisAnswerAllowed(PageParams pageParams) Applies the global answer-generation gate and the component's optional answer preference.static booleanisHybridSearchEnabled(PageParams pageParams) Combines the global hybrid-search switch with the component's retrieval mode and search type.
-
Method Details
-
getSemanticMinimumSimilarity
-
getSemanticMinimumResults
-
getRerankLexicalWeight
public static double getRerankLexicalWeight()Resolves the text-match weight, clamping finite values and replacing invalid values with the default.- Returns:
- weight in the range zero to one, or 0.15 for invalid or non-finite input
-
getHybridSearchMode
Resolves the hybrid retrieval mode, using global configuration for empty or automatic component values.- Parameters:
pageParams- optional component settings- Returns:
- trimmed mode, or an empty string when no value is available
-
getHybridShortQueryMaxChars
-
getHybridShortQueryMaxTerms
-
getHybridFallbackTopSimilarity
-
getHybridVectorWeight
-
getHybridFtsWeight
-
getHybridChunkFetchMultiplier
-
getHybridFtsUseIlikeFallback
Resolves whether full-text retrieval may fall back to a database-specific text-pattern search. Recognizes component valuestrue,trueValue,false, andfalseValue; other values retain the global setting.- Parameters:
pageParams- optional component settings- Returns:
- whether the full-text fallback is enabled
-
getHybridRrfK
-
getRagAnswerMinSimilarity
-
getRagAnswerTopK
-
getRagAnswerMaxChunkGap
-
getRagAnswerMaxBlocks
-
getRagAnswerMaxCharacters
-
getRagAnswerMaxMergedBlockCharacters
-
isHybridSearchEnabled
Combines the global hybrid-search switch with the component's retrieval mode and search type. Anoffmode disables hybrid retrieval; empty or automatic search types retain the global switch.- Parameters:
pageParams- optional component settings- Returns:
truewhen hybrid search is globally enabled and the component selection permits it
-
isAnswerAllowed
Applies the global answer-generation gate and the component's optional answer preference. Empty or automatic preferences retain the global setting; unrecognized preferences disable answers.- Parameters:
pageParams- optional component settings- Returns:
truewhen answer generation is enabled globally and allowed by the component
-