Interface SynonymService
-
public interface SynonymServiceService for managing synonyms in the search engine.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddeleteSynonym(Synonym synonym, com.broadleafcommerce.search.api.type.IndexableType indexableType, Locale locale, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Delete a synonym.voidloadSynonyms(LoadSynonymProperties loadSynonymProperties)Load any default synonyms.Optional<Synonym>readSynonym(String word, com.broadleafcommerce.search.api.type.IndexableType indexableType, Locale locale, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Read a single synonymList<Synonym>readSynonyms(com.broadleafcommerce.search.api.type.IndexableType indexableType, Locale locale, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Read all synonyms for a languageSynonymupdateSynonym(Synonym synonym, com.broadleafcommerce.search.api.type.IndexableType indexableType, Locale locale, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Update/add a synonym.List<Synonym>updateSynonyms(Collection<Synonym> synonyms, com.broadleafcommerce.search.api.type.IndexableType indexableType, Locale locale, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Update multiple synonyms.
-
-
-
Method Detail
-
readSynonyms
List<Synonym> readSynonyms(com.broadleafcommerce.search.api.type.IndexableType indexableType, Locale locale, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Read all synonyms for a language- Parameters:
indexableType- The target indexable typelocale- The target localecontextInfo- Context containing information about current tenant and application- Returns:
- A list of synonyms for a language
-
readSynonym
Optional<Synonym> readSynonym(String word, com.broadleafcommerce.search.api.type.IndexableType indexableType, Locale locale, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Read a single synonym- Parameters:
word- The target wordindexableType- The target indexable typelocale- The target localecontextInfo- Context containing information about current tenant and application- Returns:
- Synonyms for the request word, if they exist.
-
updateSynonym
Synonym updateSynonym(Synonym synonym, com.broadleafcommerce.search.api.type.IndexableType indexableType, Locale locale, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Update/add a synonym. This will create the synonym for the currently active collection, as well as its background collection.- Parameters:
synonym- The synonym to update/addindexableType- The target indexable typelocale- the target localecontextInfo- Context containing information about current tenant and application- Returns:
- The created synonym
-
updateSynonyms
List<Synonym> updateSynonyms(Collection<Synonym> synonyms, com.broadleafcommerce.search.api.type.IndexableType indexableType, Locale locale, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Update multiple synonyms. This updates for the currently active collection as well as its background collection.- Parameters:
synonyms- The synonyms to updateindexableType- The target indexable typelocale- The localecontextInfo- Context containing information about current tenant and application- Returns:
- The updated synonyms
-
deleteSynonym
void deleteSynonym(Synonym synonym, com.broadleafcommerce.search.api.type.IndexableType indexableType, Locale locale, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Delete a synonym. This will delete from the currently active collection as well as its background collection.- Parameters:
synonym- The synonym to deleteindexableType- The target indexable typelocale- The target localecontextInfo- Context containing information about current tenant and application
-
loadSynonyms
void loadSynonyms(@Nullable LoadSynonymProperties loadSynonymProperties)Load any default synonyms. This will only execute if there are no existing synonyms for a target collection and language.- Parameters:
loadSynonymProperties- Properties containing information on synonyms to load.
-
-