Package org.codelibs.fess.helper
Class DuplicateHostHelper
java.lang.Object
org.codelibs.fess.helper.DuplicateHostHelper
Helper class for managing duplicate host configurations in the Fess search system.
This class handles URL conversion based on duplicate host rules, allowing multiple
hostnames or URLs to be treated as equivalent for crawling and indexing purposes.
It maintains a list of DuplicateHost rules and applies them to URLs.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<org.codelibs.fess.opensearch.config.exentity.DuplicateHost> List of duplicate host rules for URL conversion -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(org.codelibs.fess.opensearch.config.exentity.DuplicateHost duplicateHost) Adds a new duplicate host rule to the list.Converts a URL using all configured duplicate host rules.voidinit()Initializes the duplicate host helper after construction.voidsetDuplicateHostList(List<org.codelibs.fess.opensearch.config.exentity.DuplicateHost> duplicateHostList) Sets the list of duplicate host rules.
-
Field Details
-
duplicateHostList
List of duplicate host rules for URL conversion
-
-
Constructor Details
-
DuplicateHostHelper
public DuplicateHostHelper()Default constructor for DuplicateHostHelper. Creates a new duplicate host helper instance.
-
-
Method Details
-
init
@PostConstruct public void init()Initializes the duplicate host helper after construction. Loads duplicate host configurations from the DuplicateHostService. -
setDuplicateHostList
public void setDuplicateHostList(List<org.codelibs.fess.opensearch.config.exentity.DuplicateHost> duplicateHostList) Sets the list of duplicate host rules.- Parameters:
duplicateHostList- the list of duplicate host rules to use
-
add
public void add(org.codelibs.fess.opensearch.config.exentity.DuplicateHost duplicateHost) Adds a new duplicate host rule to the list. Initializes the list if it doesn't exist.- Parameters:
duplicateHost- the duplicate host rule to add
-
convert
Converts a URL using all configured duplicate host rules. Applies each duplicate host rule in sequence to transform the URL according to the configured patterns.- Parameters:
url- the URL to convert- Returns:
- the converted URL after applying all duplicate host rules, or null if the input URL is null
-