Class DefaultIndexerSearchService
- java.lang.Object
-
- com.broadleafcommerce.search.index.core.service.DefaultIndexerSearchService
-
- All Implemented Interfaces:
IndexerSearchService<com.broadleafcommerce.search.api.domain.FieldDefinition>
public class DefaultIndexerSearchService extends Object implements IndexerSearchService<com.broadleafcommerce.search.api.domain.FieldDefinition>
-
-
Field Summary
Fields Modifier and Type Field Description static StringCACHE_BY_INDEXABLE_TYPEprotected static StringCLIENT_REGISTRATION_IDDeprecated.
-
Constructor Summary
Constructors Constructor Description DefaultIndexerSearchService(org.springframework.web.reactive.function.client.WebClient webClient, String searchServiceEndpoint, String readFieldsPath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected URIbuildSearchFieldUri(String indexableType)voidclearCache(com.broadleafcommerce.search.api.type.IndexableType indexableType)Clear any cached fields for the indexable type.protected StringgetReadFieldsPath()protected StringgetSearchServiceEndpoint()StringgetServiceClient()The service client to use when calling inventory services.protected org.springframework.web.reactive.function.client.WebClientgetWebClient()List<com.broadleafcommerce.search.api.domain.FieldDefinition>readFieldsByIndexableType(com.broadleafcommerce.search.api.type.IndexableType indexableType)Returns a list of Search fields by IndexableTypeprotected List<com.broadleafcommerce.search.api.domain.FieldDefinition>readFieldsByIndexableType(String indexableType)voidsetServiceClient(String serviceClient)The service client to use when calling inventory services.
-
-
-
Field Detail
-
CACHE_BY_INDEXABLE_TYPE
public static final String CACHE_BY_INDEXABLE_TYPE
- See Also:
- Constant Field Values
-
CLIENT_REGISTRATION_ID
@Deprecated protected static final String CLIENT_REGISTRATION_ID
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
readFieldsByIndexableType
@Cacheable(cacheNames="indexCacheByIndexableType", sync=true) public List<com.broadleafcommerce.search.api.domain.FieldDefinition> readFieldsByIndexableType(com.broadleafcommerce.search.api.type.IndexableType indexableType)Description copied from interface:IndexerSearchServiceReturns a list of Search fields by IndexableType- Specified by:
readFieldsByIndexableTypein interfaceIndexerSearchService<com.broadleafcommerce.search.api.domain.FieldDefinition>- Parameters:
indexableType- The indexable type- Returns:
- Search fields associated with the IndexableType
-
clearCache
@CacheEvict("indexCacheByIndexableType") public void clearCache(com.broadleafcommerce.search.api.type.IndexableType indexableType)Description copied from interface:IndexerSearchServiceClear any cached fields for the indexable type.- Specified by:
clearCachein interfaceIndexerSearchService<com.broadleafcommerce.search.api.domain.FieldDefinition>- Parameters:
indexableType- The indexable type to clear
-
readFieldsByIndexableType
protected List<com.broadleafcommerce.search.api.domain.FieldDefinition> readFieldsByIndexableType(String indexableType)
-
getWebClient
protected org.springframework.web.reactive.function.client.WebClient getWebClient()
-
getSearchServiceEndpoint
protected String getSearchServiceEndpoint()
-
getReadFieldsPath
protected String getReadFieldsPath()
-
getServiceClient
public String getServiceClient()
The service client to use when calling inventory services. Default is "indexerclient"
-
setServiceClient
public void setServiceClient(String serviceClient)
The service client to use when calling inventory services. Default is "indexerclient"
-
-