Class 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 request
      java.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 name
      java.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 template
      boolean 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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • skuService

        @Autowired
        private SKUService skuService
      • mongoTemplate

        @Autowired
        private org.springframework.data.mongodb.core.MongoTemplate mongoTemplate
      • aiConfiguration

        @Autowired
        private co.mastermindcms.ai.gpt.config.AiConfiguration aiConfiguration
      • chatGPTService

        @Autowired
        private co.mastermindcms.ai.gpt.services.ChatGPTService chatGPTService
      • searchContext

        private final java.util.Map<java.lang.String,​java.lang.Object> searchContext
      • mapper

        private static final com.fasterxml.jackson.databind.ObjectMapper mapper
    • Constructor Detail

      • EcomSearchEngineServiceImpl

        public EcomSearchEngineServiceImpl()
    • 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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        Parameters:
        requestJson - JSON-object of request contains an instructions for search queries
        Returns:
        database entities separated to pages
      • 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 interface EcomSearchEngineService
        Parameters:
        categoryId - identification for database entity which will be retrieved
        Returns:
        map-representation of data
      • 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 interface EcomSearchEngineService
        Parameters:
        requestJson - search request
        Returns:
        data transport entities as list
      • getSelectedUnit

        public Unit getSelectedUnit​(java.lang.String unitId)
        Description copied from interface: EcomSearchEngineService
        This method returns database entity.
        Specified by:
        getSelectedUnit in interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        Parameters:
        skuId - identification for database entity which related entities list be returned
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        Parameters:
        sellerSkuId - identification for database entity which related entities list be returned
        areaUsageType - 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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        Parameters:
        productId - for a filtering by "_id" field of database entity
        searchTerm - 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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        Parameters:
        productId - for a filtering by "_id" field of database entity
        searchTerm - 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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        Parameters:
        productId - for a filtering by "_id" field of database entity
        searchTerm - 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 interface EcomSearchEngineService
        Parameters:
        parentId - for a filtering by "_id" field of database entity
        filterType - 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 interface EcomSearchEngineService
        Parameters:
        productId - for a filtering by "_id" field of database entity
        searchTerm - for a filtering by "searchTerm" field of database entity
        filterType - 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 interface EcomSearchEngineService
        Parameters:
        parentId - for a filtering by "_id" field of database entity
        attributeId - 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 interface EcomSearchEngineService
        Parameters:
        productId - for a filtering by "_id" field of database entity
        searchTerm - for a filtering by "searchTerm" field of database entity
        attributeId - 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 interface EcomSearchEngineService
        Parameters:
        parentId - for a filtering by "_id" field of database entity
        attributeId - 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 interface EcomSearchEngineService
        Parameters:
        productId - for a filtering by "_id" field of database entity
        searchTerm - for a filtering by "searchTerm" field of database entity
        attributeId - 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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        Parameters:
        categoryId - identification for database entity which will be retrieved
        firstLetter - 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 interface EcomSearchEngineService
        Parameters:
        productId - identification for database entity which will be retrieved
        firstLetter - 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 interface EcomSearchEngineService
        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 interface EcomSearchEngineService
        Parameters:
        searchTerm - search query
        lang - iso code for current language
        offset - offset for returned items
        limit - limit for returned items
        Returns:
        map-representation of data
      • 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)