Class EcomSearchEngineServiceImpl
- java.lang.Object
-
- co.mastermindcms.modules.services.EcomSearchEngineServiceImpl
-
- All Implemented Interfaces:
EcomSearchEngineService
- Direct Known Subclasses:
EcomRemainsSearchEngineServiceImpl
@Service public class EcomSearchEngineServiceImpl extends java.lang.Object implements EcomSearchEngineService
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description EcomSearchEngineServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
aiSearchIsActive()
Checks if the AI search algorithm is currently active.private java.util.List<java.lang.String>
aiSearchKeywords(java.lang.String query)
private java.lang.String[]
doProcessSearchTerms(java.lang.String searchTerms)
private org.springframework.data.domain.Page<SellerSKU>
doSearch(java.util.List<java.lang.String> keywords, java.lang.String queryExpression, java.lang.Integer offset, java.lang.Integer limit, org.springframework.data.domain.Sort sort)
java.util.List<AttributeValue>
getActiveAttributeValuesFromSellerSKU(java.lang.String sellerSkuId)
This method returns database entities as list.java.util.List<CurrencyItem>
getAllCurrencies()
This method returns database entities as list.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getAreaUsageTypes()
This method retrieves a map, which can be processed in a templates.java.util.List<Attribute>
getAttributesFromSKU(java.lang.String skuId)
This method returns database entities as list.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getAttributeTypes()
This method retrieves a map, which can be processed in a templates.java.util.List<AttributeValue>
getAttributeValuesByAreaUsageType(java.lang.String sellerSkuId, java.lang.String areaUsageType)
This method returns database entities as list.java.util.List<AttributeValue>
getAttributeValuesFromSellerSKU(java.lang.String sellerSkuId)
This method returns database entities as list.java.util.List<SkuDTO>
getAutoSuggestResults(java.lang.String searchTerm, java.lang.String lang, java.lang.String offset, java.lang.String limit)
This method does request for the SKUs in order to suggest what fits to search typing requestjava.util.List<Category>
getCategoriesBySkuId(java.lang.String skuId)
This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.String>>
getCategoryImageUrls(java.lang.String categoryId)
This method retrieves a map, which can be processed in a templates.java.lang.String
getCdnFolderName()
This method returns CDN folder namejava.util.List<java.util.Map<java.lang.String,java.lang.String>>
getCertificateImageUrls(java.lang.String certificateId)
This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.String>>
getContainerImageUrls(java.lang.String containerId)
This method retrieves a map, which can be processed in a templates.java.util.List<Country>
getCountries()
This method returns database entity.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getCountriesOfOriginByRequestFilter(java.lang.String productId, java.lang.String searchTerm)
This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getCountriesOfOriginFilter(java.lang.String skuId)
This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getCountriesOfSellersByRequestFilter(java.lang.String productId, java.lang.String searchTerm)
This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getCountriesOfSellersFilter(java.lang.String skuId)
This method retrieves a map, which can be processed in a templates.Country
getCountryByCode(java.lang.String code)
This method returns database entity.CurrencyItem
getCurrencyByCode(java.lang.String code)
This method returns database entity.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getDeliveryTypes()
This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getDynamicByRequestFilters(java.lang.String productId, java.lang.String searchTerm, java.lang.String filterType)
This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getDynamicFilters(java.lang.String parentId, java.lang.String filterType)
This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getDynamicOptionByRequestFilters(java.lang.String productId, java.lang.String searchTerm, java.lang.String attributeId)
This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getDynamicOptionFilters(java.lang.String parentId, java.lang.String attributeId)
This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getDynamicValueByRequestFilters(java.lang.String productId, java.lang.String searchTerm, java.lang.String attributeId)
This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getDynamicValueFilters(java.lang.String parentId, java.lang.String attributeId)
This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getGeneticTypeByRequestFilter(java.lang.String productId, java.lang.String searchTerm)
This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getGeneticTypeFilter(java.lang.String skuId)
This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getGeneticTypes()
This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getIncoTerms()
This method retrieves a map, which can be processed in a templates.java.util.List<SellerSKU>
getLoggedSellerSkus()
This method returns data as list.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getLoggedSellerSkusCountriesOfOriginFilter()
This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getLoggedSellerSkusDynamicFilters(java.lang.String filterType)
This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getLoggedSellerSkusDynamicOptions(java.lang.String attributeId)
This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getLoggedSellerSkusDynamicValues(java.lang.String attributeId)
This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getLoggedSellerSkusFilter()
This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getLoggedSellerSkusGeneticTypeFilter()
This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getOptionsFromAttribute(java.lang.String attributeId)
This method retrieves a map, which can be processed in a templates.java.util.Deque<java.util.Map<java.lang.String,java.lang.Object>>
getPaginationFilter(java.lang.String requestJson)
This method does calculation for a pages based on the request.java.util.List<java.util.Map<java.lang.String,java.lang.String>>
getProductImageUrls(java.lang.String productId)
This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getProductsByCategoryAndFirstLetter(java.lang.String categoryId, java.lang.String firstLetter)
This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getProductsListByRequestFilter(java.lang.String searchTerm)
This method retrives a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getProductsListFilter()
This method retrives a map, which can be processed in a templates.protected org.springframework.data.mongodb.core.query.Criteria
getPublishedCriteria()
java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getSalutations()
This method retrieves a map, which can be processed in a templates.protected java.util.HashSet<java.lang.String>
getSearchTerms(java.lang.String searchTerm)
Unit
getSelectedUnit(java.lang.String unitId)
This method returns database entity.java.util.List<java.util.Map<java.lang.String,java.lang.String>>
getSellerImageUrls(java.lang.String sellerId)
This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.String>>
getSellerSkuImageUrls(java.lang.String sellerSkuId)
This method retrieves a map, which can be processed in a templates.java.util.List<SellerSKU>
getSellerSkus(java.lang.String skuId)
This method returns data as list.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getSellerSkuTypes()
This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getSellerTypes()
This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.String>>
getSkuImageUrls(java.lang.String skuId)
This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getSkusByProductAndFirstLetter(java.lang.String productId, java.lang.String firstLetter)
This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.String>>
getSortedProductsByCategory(java.lang.String categoryId)
This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.String>>
getSortedProductSkus(java.lang.String productId)
This method sorted and retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getTradingUnits()
This method retrieves a map, which can be processed in a templates.java.util.Map<java.lang.String,java.lang.Object>
getTranslatedUnit(java.lang.String unitId)
This method returns data as map.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getUnits()
This method retrieves a map, which can be processed in a templates.java.lang.String
getUploadListingsExcel()
This method returns path for upload listings templateboolean
isCommercialInfoAttribute(java.lang.String type)
This method checks is database entity field had some value.boolean
isListAttribute(java.lang.String type)
This method checks is database entity field had some value.boolean
isLogicalAttribute(java.lang.String type)
This method checks is database entity field had some value.boolean
isNumericAttribute(java.lang.String type)
This method checks is database entity field had some value.boolean
isPermanentSellerSKU(java.lang.String type)
This method checks is database entity field had some value.boolean
isProductRelatedAttribute(java.lang.String type)
This method checks is database entity field had some value.boolean
isRangeAttribute(java.lang.String type)
This method checks is database entity field had some value.boolean
isRemainedSellerSKU(java.lang.String type)
This method checks is database entity field had some value.boolean
isSimpleAttribute(java.lang.String type)
This method checks is database entity field had some value.boolean
isSpecialFeaturesAttribute(java.lang.String type)
This method checks is database entity field had some value.java.util.List<java.lang.String>
parseSearchQuery(java.lang.String query)
This method retrives a map, which can be processed in a templates.java.util.LinkedHashSet<Country>
searchCountries(java.lang.String requestJson)
This method does search requests and returns data as list.java.util.List<SellerSKU>
searchResults(java.lang.String requestJson)
This method does search requests and returns data as list.org.springframework.data.domain.Page<SellerSKU>
searchResultsPaged(java.lang.String requestJson)
This method does search requests and returns data as pages.boolean
showButtonsPermanentSKU(java.lang.String type)
This method checks is database entity had permanent type.boolean
showButtonsRemainedSKU(java.lang.String type)
This method checks is database entity had remained type.boolean
showSellerSkuPrice(java.lang.String sellerSkuId)
This method checks is database entity price field not null.private java.lang.String
transformFiltersToQuery(org.json.JSONObject queryJson)
private org.json.JSONObject
transformQueryWithRegexp(java.util.Map<java.lang.String,java.lang.Object> requestInitQuery, java.util.List<java.lang.String> ignoreRegexWrap)
-
-
-
Field Detail
-
sellerRepository
@Autowired private SellerRepository sellerRepository
-
sellerSkuRepository
@Autowired private SellerSkuRepository sellerSkuRepository
-
unitRepository
@Autowired private UnitRepository unitRepository
-
languageRepository
@Autowired private LanguageRepository languageRepository
-
settingsRepository
@Autowired private WebSiteSettingsRepository settingsRepository
-
salesCatalogService
@Autowired private SalesCatalogService salesCatalogService
-
skuService
@Autowired private SKUService skuService
-
productService
@Autowired private ProductService productService
-
categoryService
@Autowired private CategoryService categoryService
-
userManagementService
@Autowired private UserManagementService userManagementService
-
attributeService
@Autowired private AttributeService attributeService
-
geoLocationService
@Autowired private GeoLocationService geoLocationService
-
certificateRepository
@Autowired private CertificateRepository certificateRepository
-
translationService
@Autowired private TranslationService translationService
-
containerService
@Autowired private ContentContainerService containerService
-
accessManagementService
@Autowired private AccessManagementService accessManagementService
-
mongoTemplate
@Autowired private org.springframework.data.mongodb.core.MongoTemplate mongoTemplate
-
commerceProperties
@Autowired private CommerceProperties commerceProperties
-
commonProperties
@Autowired private CommonProperties commonProperties
-
aiConfiguration
@Autowired private co.mastermindcms.ai.gpt.config.AiConfiguration aiConfiguration
-
chatGPTService
@Autowired private co.mastermindcms.ai.gpt.services.ChatGPTService chatGPTService
-
marketingService
@Autowired private MarketingService marketingService
-
searchContext
private final java.util.Map<java.lang.String,java.lang.Object> searchContext
-
mapper
private static final com.fasterxml.jackson.databind.ObjectMapper mapper
-
-
Method Detail
-
searchResults
public java.util.List<SellerSKU> searchResults(java.lang.String requestJson)
Description copied from interface:EcomSearchEngineService
This method does search requests and returns data as list.- Specified by:
searchResults
in interfaceEcomSearchEngineService
- Parameters:
requestJson
- search json- Returns:
- database entities as list
-
searchResultsPaged
public org.springframework.data.domain.Page<SellerSKU> searchResultsPaged(java.lang.String requestJson)
Description copied from interface:EcomSearchEngineService
This method does search requests and returns data as pages.- Specified by:
searchResultsPaged
in interfaceEcomSearchEngineService
- Parameters:
requestJson
- JSON-object of request contains an instructions for search queries- Returns:
- database entities separated to pages
-
getCdnFolderName
public java.lang.String getCdnFolderName()
Description copied from interface:EcomSearchEngineService
This method returns CDN folder name- Specified by:
getCdnFolderName
in interfaceEcomSearchEngineService
- Returns:
- value as string
-
getUploadListingsExcel
public java.lang.String getUploadListingsExcel()
Description copied from interface:EcomSearchEngineService
This method returns path for upload listings template- Specified by:
getUploadListingsExcel
in interfaceEcomSearchEngineService
- Returns:
- value as string
-
getSortedProductsByCategory
public java.util.List<java.util.Map<java.lang.String,java.lang.String>> getSortedProductsByCategory(java.lang.String categoryId)
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getSortedProductsByCategory
in interfaceEcomSearchEngineService
- Parameters:
categoryId
- identification for database entity which will be retrieved- Returns:
- map-representation of data
-
getAllCurrencies
public java.util.List<CurrencyItem> getAllCurrencies()
Description copied from interface:EcomSearchEngineService
This method returns database entities as list.- Specified by:
getAllCurrencies
in interfaceEcomSearchEngineService
- Returns:
- database entities as list
-
getCurrencyByCode
public CurrencyItem getCurrencyByCode(java.lang.String code)
Description copied from interface:EcomSearchEngineService
This method returns database entity.- Specified by:
getCurrencyByCode
in interfaceEcomSearchEngineService
- Parameters:
code
- for filter and return database entity- Returns:
- database entity
-
searchCountries
public java.util.LinkedHashSet<Country> searchCountries(java.lang.String requestJson)
Description copied from interface:EcomSearchEngineService
This method does search requests and returns data as list.- Specified by:
searchCountries
in interfaceEcomSearchEngineService
- Parameters:
requestJson
- search request- Returns:
- data transport entities as list
-
getCountries
public java.util.List<Country> getCountries()
Description copied from interface:EcomSearchEngineService
This method returns database entity.- Specified by:
getCountries
in interfaceEcomSearchEngineService
- Returns:
- database entities as list
-
getCountryByCode
public Country getCountryByCode(java.lang.String code)
Description copied from interface:EcomSearchEngineService
This method returns database entity.- Specified by:
getCountryByCode
in interfaceEcomSearchEngineService
- Parameters:
code
- for filter and return database entity- Returns:
- database entity
-
getSelectedUnit
public Unit getSelectedUnit(java.lang.String unitId)
Description copied from interface:EcomSearchEngineService
This method returns database entity.- Specified by:
getSelectedUnit
in interfaceEcomSearchEngineService
- Parameters:
unitId
- identification for filter and return database entity- Returns:
- database entity
-
getTranslatedUnit
public java.util.Map<java.lang.String,java.lang.Object> getTranslatedUnit(java.lang.String unitId)
Description copied from interface:EcomSearchEngineService
This method returns data as map.- Specified by:
getTranslatedUnit
in interfaceEcomSearchEngineService
- Parameters:
unitId
- identification for filter and return data- Returns:
- data as map
-
getUnits
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getUnits()
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getUnits
in interfaceEcomSearchEngineService
- Returns:
- map-representation of data
-
getSellerImageUrls
public java.util.List<java.util.Map<java.lang.String,java.lang.String>> getSellerImageUrls(java.lang.String sellerId)
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getSellerImageUrls
in interfaceEcomSearchEngineService
- Parameters:
sellerId
- identification for database entity which will be retrieved- Returns:
- map-representation of data
-
getCategoryImageUrls
public java.util.List<java.util.Map<java.lang.String,java.lang.String>> getCategoryImageUrls(java.lang.String categoryId)
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getCategoryImageUrls
in interfaceEcomSearchEngineService
- Parameters:
categoryId
- identification for database entity which will be retrieved- Returns:
- map-representation of data
-
getProductImageUrls
public java.util.List<java.util.Map<java.lang.String,java.lang.String>> getProductImageUrls(java.lang.String productId)
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getProductImageUrls
in interfaceEcomSearchEngineService
- Parameters:
productId
- identification for database entity which will be retrieved- Returns:
- map-representation of data
-
getSellerSkuImageUrls
public java.util.List<java.util.Map<java.lang.String,java.lang.String>> getSellerSkuImageUrls(java.lang.String sellerSkuId)
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getSellerSkuImageUrls
in interfaceEcomSearchEngineService
- Parameters:
sellerSkuId
- identification for database entity which will be retrieved- Returns:
- map-representation of data
-
getCertificateImageUrls
public java.util.List<java.util.Map<java.lang.String,java.lang.String>> getCertificateImageUrls(java.lang.String certificateId)
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getCertificateImageUrls
in interfaceEcomSearchEngineService
- Parameters:
certificateId
- identification for database entity which will be retrieved- Returns:
- map-representation of data
-
getContainerImageUrls
public java.util.List<java.util.Map<java.lang.String,java.lang.String>> getContainerImageUrls(java.lang.String containerId)
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getContainerImageUrls
in interfaceEcomSearchEngineService
- Parameters:
containerId
- identification for database entity which will be retrieved- Returns:
- map-representation of data
-
getSkuImageUrls
public java.util.List<java.util.Map<java.lang.String,java.lang.String>> getSkuImageUrls(java.lang.String skuId)
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getSkuImageUrls
in interfaceEcomSearchEngineService
- Parameters:
skuId
- identification for database entity which will be retrieved- Returns:
- map-representation of data
-
getGeneticTypes
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getGeneticTypes()
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getGeneticTypes
in interfaceEcomSearchEngineService
- Returns:
- map-representation of data
-
getSellerTypes
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getSellerTypes()
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getSellerTypes
in interfaceEcomSearchEngineService
- Returns:
- map-representation of data
-
getSellerSkuTypes
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getSellerSkuTypes()
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getSellerSkuTypes
in interfaceEcomSearchEngineService
- Returns:
- map-representation of data
-
getSalutations
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getSalutations()
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getSalutations
in interfaceEcomSearchEngineService
- Returns:
- map-representation of data
-
getIncoTerms
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getIncoTerms()
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getIncoTerms
in interfaceEcomSearchEngineService
- Returns:
- map-representation of data
-
getDeliveryTypes
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getDeliveryTypes()
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getDeliveryTypes
in interfaceEcomSearchEngineService
- Returns:
- map-representation of data
-
getTradingUnits
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getTradingUnits()
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getTradingUnits
in interfaceEcomSearchEngineService
- Returns:
- map-representation of data
-
getAttributeTypes
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getAttributeTypes()
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getAttributeTypes
in interfaceEcomSearchEngineService
- Returns:
- map-representation of data
-
getAreaUsageTypes
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getAreaUsageTypes()
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getAreaUsageTypes
in interfaceEcomSearchEngineService
- Returns:
- map-representation of data
-
getOptionsFromAttribute
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getOptionsFromAttribute(java.lang.String attributeId)
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getOptionsFromAttribute
in interfaceEcomSearchEngineService
- Parameters:
attributeId
- identification for database entity which will be retrieved- Returns:
- map-representation of data
-
getSellerSkus
public java.util.List<SellerSKU> getSellerSkus(java.lang.String skuId)
Description copied from interface:EcomSearchEngineService
This method returns data as list.- Specified by:
getSellerSkus
in interfaceEcomSearchEngineService
- Parameters:
skuId
- identification for database entity which related entities list be returned- Returns:
- database entities as list
-
getLoggedSellerSkus
public java.util.List<SellerSKU> getLoggedSellerSkus()
Description copied from interface:EcomSearchEngineService
This method returns data as list.- Specified by:
getLoggedSellerSkus
in interfaceEcomSearchEngineService
- Returns:
- database entities as list
-
getLoggedSellerSkusFilter
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getLoggedSellerSkusFilter()
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getLoggedSellerSkusFilter
in interfaceEcomSearchEngineService
- Returns:
- map-representation of data
-
getLoggedSellerSkusCountriesOfOriginFilter
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getLoggedSellerSkusCountriesOfOriginFilter()
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getLoggedSellerSkusCountriesOfOriginFilter
in interfaceEcomSearchEngineService
- Returns:
- map-representation of data
-
getLoggedSellerSkusGeneticTypeFilter
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getLoggedSellerSkusGeneticTypeFilter()
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getLoggedSellerSkusGeneticTypeFilter
in interfaceEcomSearchEngineService
- Returns:
- map-representation of data
-
getLoggedSellerSkusDynamicFilters
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getLoggedSellerSkusDynamicFilters(java.lang.String filterType)
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getLoggedSellerSkusDynamicFilters
in interfaceEcomSearchEngineService
- Parameters:
filterType
- for a filtering by "type" field of database entity- Returns:
- map-representation of data
-
getLoggedSellerSkusDynamicOptions
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getLoggedSellerSkusDynamicOptions(java.lang.String attributeId)
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getLoggedSellerSkusDynamicOptions
in interfaceEcomSearchEngineService
- Parameters:
attributeId
- for a filtering by "_id" field of database entity- Returns:
- map-representation of data
-
getLoggedSellerSkusDynamicValues
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getLoggedSellerSkusDynamicValues(java.lang.String attributeId)
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getLoggedSellerSkusDynamicValues
in interfaceEcomSearchEngineService
- Parameters:
attributeId
- for a filtering by "_id" field of database entity- Returns:
- map-representation of data
-
getAttributesFromSKU
public java.util.List<Attribute> getAttributesFromSKU(java.lang.String skuId)
Description copied from interface:EcomSearchEngineService
This method returns database entities as list.- Specified by:
getAttributesFromSKU
in interfaceEcomSearchEngineService
- Parameters:
skuId
- identification for database entity which related entities list be returned- Returns:
- database entities as list
-
getAttributeValuesFromSellerSKU
public java.util.List<AttributeValue> getAttributeValuesFromSellerSKU(java.lang.String sellerSkuId)
Description copied from interface:EcomSearchEngineService
This method returns database entities as list.- Specified by:
getAttributeValuesFromSellerSKU
in interfaceEcomSearchEngineService
- Parameters:
sellerSkuId
- identification for database entity which related entities list be returned- Returns:
- database entities as list
-
getAttributeValuesByAreaUsageType
public java.util.List<AttributeValue> getAttributeValuesByAreaUsageType(java.lang.String sellerSkuId, java.lang.String areaUsageType)
Description copied from interface:EcomSearchEngineService
This method returns database entities as list.- Specified by:
getAttributeValuesByAreaUsageType
in interfaceEcomSearchEngineService
- Parameters:
sellerSkuId
- identification for database entity which related entities list be returnedareaUsageType
- type of usage area- Returns:
- database entities as list
-
getActiveAttributeValuesFromSellerSKU
public java.util.List<AttributeValue> getActiveAttributeValuesFromSellerSKU(java.lang.String sellerSkuId)
Description copied from interface:EcomSearchEngineService
This method returns database entities as list.- Specified by:
getActiveAttributeValuesFromSellerSKU
in interfaceEcomSearchEngineService
- Parameters:
sellerSkuId
- identification for database entity which related entities list be returned- Returns:
- database entities as list
-
getCountriesOfOriginFilter
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getCountriesOfOriginFilter(java.lang.String skuId)
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getCountriesOfOriginFilter
in interfaceEcomSearchEngineService
- Parameters:
skuId
- for a filtering by "_id" field of database entity- Returns:
- map-representation of data
-
getCountriesOfOriginByRequestFilter
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getCountriesOfOriginByRequestFilter(java.lang.String productId, java.lang.String searchTerm)
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getCountriesOfOriginByRequestFilter
in interfaceEcomSearchEngineService
- Parameters:
productId
- for a filtering by "_id" field of database entitysearchTerm
- for a filtering by "searchTerm" field of database entity- Returns:
- map-representation of data
-
getCountriesOfSellersFilter
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getCountriesOfSellersFilter(java.lang.String skuId)
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getCountriesOfSellersFilter
in interfaceEcomSearchEngineService
- Parameters:
skuId
- for a filtering by "_id" field of database entity- Returns:
- map-representation of data
-
getCountriesOfSellersByRequestFilter
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getCountriesOfSellersByRequestFilter(java.lang.String productId, java.lang.String searchTerm)
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getCountriesOfSellersByRequestFilter
in interfaceEcomSearchEngineService
- Parameters:
productId
- for a filtering by "_id" field of database entitysearchTerm
- for a filtering by "searchTerm" field of database entity- Returns:
- map-representation of data
-
getGeneticTypeFilter
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getGeneticTypeFilter(java.lang.String skuId)
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getGeneticTypeFilter
in interfaceEcomSearchEngineService
- Parameters:
skuId
- for a filtering by "_id" field of database entity- Returns:
- map-representation of data
-
getGeneticTypeByRequestFilter
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getGeneticTypeByRequestFilter(java.lang.String productId, java.lang.String searchTerm)
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getGeneticTypeByRequestFilter
in interfaceEcomSearchEngineService
- Parameters:
productId
- for a filtering by "_id" field of database entitysearchTerm
- for a filtering by "searchTerm" field of database entity- Returns:
- map-representation of data
-
getDynamicFilters
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getDynamicFilters(java.lang.String parentId, java.lang.String filterType)
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getDynamicFilters
in interfaceEcomSearchEngineService
- Parameters:
parentId
- for a filtering by "_id" field of database entityfilterType
- for a filtering by "type" field of database entity- Returns:
- map-representation of data
-
getDynamicByRequestFilters
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getDynamicByRequestFilters(java.lang.String productId, java.lang.String searchTerm, java.lang.String filterType)
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getDynamicByRequestFilters
in interfaceEcomSearchEngineService
- Parameters:
productId
- for a filtering by "_id" field of database entitysearchTerm
- for a filtering by "searchTerm" field of database entityfilterType
- for a filtering by "type" field of database entity- Returns:
- map-representation of data
-
getDynamicOptionFilters
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getDynamicOptionFilters(java.lang.String parentId, java.lang.String attributeId)
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getDynamicOptionFilters
in interfaceEcomSearchEngineService
- Parameters:
parentId
- for a filtering by "_id" field of database entityattributeId
- for a filtering by "_id" field of database entity- Returns:
- map-representation of data
-
getDynamicOptionByRequestFilters
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getDynamicOptionByRequestFilters(java.lang.String productId, java.lang.String searchTerm, java.lang.String attributeId)
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getDynamicOptionByRequestFilters
in interfaceEcomSearchEngineService
- Parameters:
productId
- for a filtering by "_id" field of database entitysearchTerm
- for a filtering by "searchTerm" field of database entityattributeId
- for a filtering by "_id" field of database entity- Returns:
- map-representation of data
-
getDynamicValueFilters
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getDynamicValueFilters(java.lang.String parentId, java.lang.String attributeId)
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getDynamicValueFilters
in interfaceEcomSearchEngineService
- Parameters:
parentId
- for a filtering by "_id" field of database entityattributeId
- for a filtering by "_id" field of database entity- Returns:
- map-representation of data
-
getDynamicValueByRequestFilters
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getDynamicValueByRequestFilters(java.lang.String productId, java.lang.String searchTerm, java.lang.String attributeId)
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getDynamicValueByRequestFilters
in interfaceEcomSearchEngineService
- Parameters:
productId
- for a filtering by "_id" field of database entitysearchTerm
- for a filtering by "searchTerm" field of database entityattributeId
- for a filtering by "_id" field of database entity- Returns:
- map-representation of data
-
getPaginationFilter
public java.util.Deque<java.util.Map<java.lang.String,java.lang.Object>> getPaginationFilter(java.lang.String requestJson)
Description copied from interface:EcomSearchEngineService
This method does calculation for a pages based on the request.- Specified by:
getPaginationFilter
in interfaceEcomSearchEngineService
- Parameters:
requestJson
- JSON-object of request contains an instructions for search queries- Returns:
- map-representation of data
-
getProductsListFilter
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getProductsListFilter()
Description copied from interface:EcomSearchEngineService
This method retrives a map, which can be processed in a templates.- Specified by:
getProductsListFilter
in interfaceEcomSearchEngineService
- Returns:
- map-representation of data
-
getProductsListByRequestFilter
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getProductsListByRequestFilter(java.lang.String searchTerm)
Description copied from interface:EcomSearchEngineService
This method retrives a map, which can be processed in a templates.- Specified by:
getProductsListByRequestFilter
in interfaceEcomSearchEngineService
- Parameters:
searchTerm
- for a filtering by "searchTerm" field of database entity- Returns:
- map-representation of data
-
showButtonsPermanentSKU
public boolean showButtonsPermanentSKU(java.lang.String type)
Description copied from interface:EcomSearchEngineService
This method checks is database entity had permanent type.- Specified by:
showButtonsPermanentSKU
in interfaceEcomSearchEngineService
- Parameters:
type
- field for database entity which will be checked- Returns:
- value as boolean
-
showButtonsRemainedSKU
public boolean showButtonsRemainedSKU(java.lang.String type)
Description copied from interface:EcomSearchEngineService
This method checks is database entity had remained type.- Specified by:
showButtonsRemainedSKU
in interfaceEcomSearchEngineService
- Parameters:
type
- field for database entity which will be checked- Returns:
- value as boolean
-
showSellerSkuPrice
public boolean showSellerSkuPrice(java.lang.String sellerSkuId)
Description copied from interface:EcomSearchEngineService
This method checks is database entity price field not null.- Specified by:
showSellerSkuPrice
in interfaceEcomSearchEngineService
- Parameters:
sellerSkuId
- identification for database entity which will be checked- Returns:
- value as boolean
-
isPermanentSellerSKU
public boolean isPermanentSellerSKU(java.lang.String type)
Description copied from interface:EcomSearchEngineService
This method checks is database entity field had some value.- Specified by:
isPermanentSellerSKU
in interfaceEcomSearchEngineService
- Parameters:
type
- field for database entity which will be checked- Returns:
- value as boolean
-
isRemainedSellerSKU
public boolean isRemainedSellerSKU(java.lang.String type)
Description copied from interface:EcomSearchEngineService
This method checks is database entity field had some value.- Specified by:
isRemainedSellerSKU
in interfaceEcomSearchEngineService
- Parameters:
type
- field for database entity which will be checked- Returns:
- value as boolean
-
isListAttribute
public boolean isListAttribute(java.lang.String type)
Description copied from interface:EcomSearchEngineService
This method checks is database entity field had some value.- Specified by:
isListAttribute
in interfaceEcomSearchEngineService
- Parameters:
type
- field for database entity which will be checked- Returns:
- value as boolean
-
isRangeAttribute
public boolean isRangeAttribute(java.lang.String type)
Description copied from interface:EcomSearchEngineService
This method checks is database entity field had some value.- Specified by:
isRangeAttribute
in interfaceEcomSearchEngineService
- Parameters:
type
- field for database entity which will be checked- Returns:
- value as boolean
-
isSimpleAttribute
public boolean isSimpleAttribute(java.lang.String type)
Description copied from interface:EcomSearchEngineService
This method checks is database entity field had some value.- Specified by:
isSimpleAttribute
in interfaceEcomSearchEngineService
- Parameters:
type
- field for database entity which will be checked- Returns:
- value as boolean
-
isLogicalAttribute
public boolean isLogicalAttribute(java.lang.String type)
Description copied from interface:EcomSearchEngineService
This method checks is database entity field had some value.- Specified by:
isLogicalAttribute
in interfaceEcomSearchEngineService
- Parameters:
type
- field for database entity which will be checked- Returns:
- value as boolean
-
isNumericAttribute
public boolean isNumericAttribute(java.lang.String type)
Description copied from interface:EcomSearchEngineService
This method checks is database entity field had some value.- Specified by:
isNumericAttribute
in interfaceEcomSearchEngineService
- Parameters:
type
- field for database entity which will be checked- Returns:
- value as boolean
-
isProductRelatedAttribute
public boolean isProductRelatedAttribute(java.lang.String type)
Description copied from interface:EcomSearchEngineService
This method checks is database entity field had some value.- Specified by:
isProductRelatedAttribute
in interfaceEcomSearchEngineService
- Parameters:
type
- field for database entity which will be checked- Returns:
- value as boolean
-
isCommercialInfoAttribute
public boolean isCommercialInfoAttribute(java.lang.String type)
Description copied from interface:EcomSearchEngineService
This method checks is database entity field had some value.- Specified by:
isCommercialInfoAttribute
in interfaceEcomSearchEngineService
- Parameters:
type
- field for database entity which will be checked- Returns:
- value as boolean
-
isSpecialFeaturesAttribute
public boolean isSpecialFeaturesAttribute(java.lang.String type)
Description copied from interface:EcomSearchEngineService
This method checks is database entity field had some value.- Specified by:
isSpecialFeaturesAttribute
in interfaceEcomSearchEngineService
- Parameters:
type
- field for database entity which will be checked- Returns:
- value as boolean
-
parseSearchQuery
public java.util.List<java.lang.String> parseSearchQuery(java.lang.String query)
Description copied from interface:EcomSearchEngineService
This method retrives a map, which can be processed in a templates.- Specified by:
parseSearchQuery
in interfaceEcomSearchEngineService
- Parameters:
query
- query for a process search with Ai- Returns:
- list from keywords
-
getSortedProductSkus
public java.util.List<java.util.Map<java.lang.String,java.lang.String>> getSortedProductSkus(java.lang.String productId)
Description copied from interface:EcomSearchEngineService
This method sorted and retrieves a map, which can be processed in a templates.- Specified by:
getSortedProductSkus
in interfaceEcomSearchEngineService
- Parameters:
productId
- identification for database entity which will be retrieved- Returns:
- map-representation of data
-
getProductsByCategoryAndFirstLetter
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getProductsByCategoryAndFirstLetter(java.lang.String categoryId, java.lang.String firstLetter)
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getProductsByCategoryAndFirstLetter
in interfaceEcomSearchEngineService
- Parameters:
categoryId
- identification for database entity which will be retrievedfirstLetter
- first letter of the name for the product- Returns:
- map-representation of data
-
getSkusByProductAndFirstLetter
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getSkusByProductAndFirstLetter(java.lang.String productId, java.lang.String firstLetter)
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getSkusByProductAndFirstLetter
in interfaceEcomSearchEngineService
- Parameters:
productId
- identification for database entity which will be retrievedfirstLetter
- first letter of the name for the sku- Returns:
- map-representation of data
-
getCategoriesBySkuId
public java.util.List<Category> getCategoriesBySkuId(java.lang.String skuId)
Description copied from interface:EcomSearchEngineService
This method retrieves a map, which can be processed in a templates.- Specified by:
getCategoriesBySkuId
in interfaceEcomSearchEngineService
- Parameters:
skuId
- identification for database entity which will be retrieved- Returns:
- map-representation of data
-
getAutoSuggestResults
public java.util.List<SkuDTO> getAutoSuggestResults(java.lang.String searchTerm, java.lang.String lang, java.lang.String offset, java.lang.String limit)
Description copied from interface:EcomSearchEngineService
This method does request for the SKUs in order to suggest what fits to search typing request- Specified by:
getAutoSuggestResults
in interfaceEcomSearchEngineService
- Parameters:
searchTerm
- search querylang
- iso code for current languageoffset
- offset for returned itemslimit
- limit for returned items- Returns:
- map-representation of data
-
aiSearchIsActive
public boolean aiSearchIsActive()
Description copied from interface:EcomSearchEngineService
Checks if the AI search algorithm is currently active.- Specified by:
aiSearchIsActive
in interfaceEcomSearchEngineService
- Returns:
- true if the AI search algorithm is active, false otherwise
-
transformFiltersToQuery
private java.lang.String transformFiltersToQuery(org.json.JSONObject queryJson)
-
doSearch
private org.springframework.data.domain.Page<SellerSKU> doSearch(java.util.List<java.lang.String> keywords, java.lang.String queryExpression, java.lang.Integer offset, java.lang.Integer limit, org.springframework.data.domain.Sort sort)
-
doProcessSearchTerms
private java.lang.String[] doProcessSearchTerms(java.lang.String searchTerms)
-
aiSearchKeywords
private java.util.List<java.lang.String> aiSearchKeywords(java.lang.String query)
-
transformQueryWithRegexp
private org.json.JSONObject transformQueryWithRegexp(java.util.Map<java.lang.String,java.lang.Object> requestInitQuery, java.util.List<java.lang.String> ignoreRegexWrap)
-
getPublishedCriteria
protected org.springframework.data.mongodb.core.query.Criteria getPublishedCriteria()
-
getSearchTerms
protected java.util.HashSet<java.lang.String> getSearchTerms(java.lang.String searchTerm)
-
-