Git Product home page Git Product logo

productsearch's People

Contributors

davidg-klevu avatar forgiveme avatar klevu avatar richard-hardman avatar sandipklevu avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

productsearch's Issues

Confusing CLI command description in klevu:syncdata

The command klevu:syncdata states it will sync even CMS pages too,

Sync Product, Category, CMS and Order data with Klevu for all stores.

but apparently CMS data won't be synced via this command, because that part is commented out:

// sync cms data moved to the klevu:syncstore:storecode command

I suggest to remove the CMS from the description or put back the commented out CMS synchronisation call.

Native Magento Search Suggestions

It looks like there was a "fix" implemented by the disableautosuggest.js file to set the minSearchLength to 200 so that native search suggestion requests aren't triggered. However, in Magento 2.3.5 (Commerce) this "fix" no longer seems to work. This means that the native search suggestion ajax request is triggering alongside the request to Klevu. So far, I've got around this by simply updating the corresponding configuration setting in admin to be 200. However, I'm not sure if this is the ideal solution.

Question: Too late for the schedule

Hello,

We set Europe/Stockholm in both php configuration as well as in server system tzdata setup.

However the cron klevu_search_product_sync is schedule with 1h in advanced always and is receiving all the time the message Too late for the schedule, see: https://s.nimbus.everhelper.me/share/1258888/l0fwzn69k6bob6eybt4e.

Maybe this is expected results, because in config is set to run at 0 */3 * * * (every 3 hours). Even so, it looks weird to be set for an hour in the past?

Error on accessing Search configurations in Admin panel

Preconditions

  1. Magento 2.2.1 CE
  2. Ubuntu 16.04.3 PHP 7.0.22, Apache

Steps to reproduce

  1. Integrate Klevu with composer by following instructions
  2. Go to Admin panel and navigate to Stores -> Configuration -> Klevu -> Search Configuration

Expected result

  1. Browse Klevu search configurations

Actual result

Error message from report.

1 exception(s):
Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'klevu/search/form/field/sync/downloadbutton.phtml' in module: 'Klevu_Search' block's name: 'adminhtml\form\field\logdownload_0'
...

If commenting out line protected $_template = 'klevu/search/form/field/sync/downloadbutton.phtml'; in vendor/klevu/module-productsearch/Block/Adminhtml/Form/Field/Logdownload.php configurations work just fine and error doesn't appear.

Configuration loading does not respect env.php or config.php settings

Due to the loading mechanism of store data for syncing, configs made in the env.php and/or config.php are not taken into account.

The loading of the data happens in

$storefromscope = $this->_searchHelperData->storeFromScopeId();

In the called helper method the store configuration is loaded via the config data collection.

$configs = $this->_configDataCollection->addFieldToFilter('value',$this->getJsApiKey())->load();

Assuming the configuration comes from the config PHP files, the filtered value may not exist in the core_config_data table.
This results in an error when the following

$storefromscope->getWebsite()->getName(),

tries to resolve the website property.

We mitigated this by setting the corresponging value(s) in the table. Unfortunately this 'complicates' our build process for our various testing instances.

Magento 2 - laminas/laminas-server version 2.17.0 no compatible with latest module version

Latest module version is not compatible with laminas/laminas-server:2.17.0
This new laminas-server version removes laminas/zend mapping and doing so breaks module as it still uses Zend\Http

For now without actually patching module is to lock laminas/laminas-server to version 2.16.0

$this->method = \Zend\Http\Client::GET;

Sample use of Zend\Http classes

Error in UpgradeSchema

After upgrading module to 2.2.8 setup:upgrade produces the following error

SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table definition; there can be only one auto column and it must be defined as a key, query was: ALTER TABLE klevu_product_sync DROP PRIMARY KEY

mismatch in getDefaultMappedAttributes array

Hi.

We have version 3.2.1.

I noticed in:

vendor/klevu/module-productsearch/Helper/Config.php:getDefaultMappedAttributes

that the mapping array does not match between Magento and Klevu attributes. After second 'price' in Magento attributes there is 'tax_class_id' when in Klevu side there is 'salePrice'. Copy + paste problem I guess as 'salePrice' is also before it. Also should final price from Magento side to be mapped to 'salePrice' anyway?

return [ "magento_attribute" => [ "name", "sku", "image", "small_image", "media_gallery", "status", "description", "short_description", "price", "price", "tax_class_id", "weight", Rating::ATTRIBUTE_CODE, ReviewCount::ATTRIBUTE_CODE, "special_price", "special_from_date", "special_to_date", "visibility", "created_at" ], "klevu_attribute" => [ "name", "sku", "image", "small_image", "media_gallery", "status", "desc", "shortDesc", "price", "salePrice", "salePrice", "weight", Rating::ATTRIBUTE_CODE, 'rating_count', "special_price", "special_from_date", "special_to_date", "visibility", "dateAdded" ] ];

Usage of \Zend\Log\Logger causing errors

There are a few usages of the old \Zend\Log\Logger still instead of being replaced by the Klevu LoggerConstants:

  • Model/Config/Backend/Trigger.php at Line 83
  • Model/Order/Sync.php at Lines 372, 382 and 393

Replacing those mentions with LoggerConstants clears up the errors occuring during the order sync process and also when trying to open the backend config page.

GetStoresUsingApiKeysInterface.php breaks swagger schema

The schema is broken https://magento.local/rest/all/schema?services=all

<message>The "array" class doesn't exist and the namespace must be specified. Verify and try again.</message>
...
Magento\Webapi\Model\Config\ClassReflector->reflectClassMethods('Klevu\\Search\\Ap...', Array)

Because

https://github.com/klevu/productsearch/blob/master/Api/Service/Account/GetStoresUsingApiKeysInterface.php

has return type @return array magento cannot build swagger schema, needs to be replaced with actual type or as workaround @return mixed[]

Filter issues

When applying filters on category pages with Magento 2.2EE and Klevu 2.1.22. The IndexBuilder (Model/Search/IndexBuilder) appears to cause issues when filters are applied. For example, applying a size attribute filter, causes the following error to be thrown:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'size_filter.value' in 'where clause', query was: INSERT INTO search_tmp_59f89571894ff0_15825268 SELECT main_select.entity_id, SUM(score) AS relevance FROM (SELECT search_index.entity_id, (((0) + (0) + (0)) * 1) AS score FROM catalogsearch_fulltext_scope1 AS search_index
LEFT JOIN catalog_eav_attribute AS cea ON search_index.attribute_id = cea.attribute_id
INNER JOIN catalog_category_product_index AS category_ids_index ON search_index.entity_id = category_ids_index.product_id AND category_ids_index.store_id = '1' WHERE (category_ids_index.category_id = 69) AND (size_filter.value = '202')) AS main_select GROUP BY entity_id ORDER BY relevance DESC, entity_id DESC
LIMIT 10000

Disabling Klevu appears to currently fix the issue, so it appears that this isn't triggering an extra table somewhere?

Problem with error logging

Hi.

We have version 3.2.1.

In:

vendor/klevu/module-productsearch/Model/Api/Action/Addrecords.php:prepareOtherParameters

there is error logged:

$this->_searchHelperData->log( LoggerConstants::ZEND_LOG_ERR, __( '%1: Multi dimensional array provided for "other" for SKU %2 : attribute %3.', __METHOD__, $record['sku'], $key ) );

But how it looks in log file:

[2023-03-23T11:50:29.828253+00:00] Klevu.ERROR: %s: Multi dimensional array provided for "other" attribute for SKU $s. [] []

which makes harder to check which product caused the error. So there is problem with sprintf functionality in this case.

Thanks,
Seppo

Array sizes are inconsistent when running multisort

Preconditions

  • Magento 2.3.4
  • Klevu - 2.2.19
  • Stores > Config > klevu > Search Settings > Search Result Page settings > Use klevu relevance
  • Stores > Config > klevu > Search Settings > Search Result Page settings > Preserve your theme layout

issue

  • When rendering search results page a PHP warning is thrown
Warning: array_multisort(): Array sizes are inconsistent in vendor/klevu/module-productsearch/Plugin/Api/Search/SearchResult.php on line 59

Fix

This is happening because 2 or more products have the same score value causing the array in the multisort to not be the same size as the result array

We suggest using a unique key for each score value

$result_key[$key] = $item->getCustomAttribute("score")->getValue(); 
$key++;

in

$result_key[$item->getCustomAttribute("score")->getValue()] = $item->getCustomAttribute("score")->getValue();

$key is initialized to 0 outside the for loop

Error: Multi dimensional array provided for "other" attribute

Below error is thrown in the log files:

Klevu.ERROR: Klevu\Search\Model\Api\Action\Addrecords::prepareOtherParameters: Multi dimensional array provided for "other" attribute for SKU ... . [] []

Adobe Commerce version: 2.4.6-p1
Klevu version: 3.3.3

Query on Plugin use

public function processProductAfter(&$product, &$parent, &$item)

Hi, we are trying to use an after plugin on the provided method and add data to the product array data on the method linked (v2.9.3).
Either our understanding of use for the method is incorrect (it's not for Plugins to hook) or this is not working as expected?

Might be better if this was just a standard $product = $this->processProductAfter($product, $parent, $item) to allow plugins to hook into?

Apologies if the question seems silly, but my colleagues & I were trying to figure out why after plugin was not working as expected.
THe plugin was triggered and the data were assigned internally, but on the parent method the new array values were missing from $product

Incorrect after plugin

The plugin defined at Klevu\Search\Plugin\CatalogRule\Model\Indexer\IndexBuilder\ReindexByIdsPlugin::afterReindexByIds (check the file here) expects that Magento\CatalogRule\Model\Indexer\IndexBuilder::reindexByIds return an array, but that method has a void return type. (check the file here)

Then, magento reindex fails with:

Klevu\Search\Plugin\CatalogRule\Model\Indexer\IndexBuilder\ReindexByIdsPlugin::afterReindexByIds(): Argument #2 ($productIds) must be of type array, null given

The specific reindex error case I'm getting is this:

  • Set catalogrule_product to run by schedule
    • bin/magento indexer:set-mode schedule catalogrule_product
  • Make any changes to product rules to generate backlog items on catalogrule_product
  • Run the cron
  • Check cron_schedule table with the error.

I used magerun to execute specifically indexer_update_all_views which was where I found the plugin error.
n98 sys:cron:run indexer_update_all_views.

klevu_product_sync_cl Table Size Issue

Issue

klevu_product_sync_cl grows much larger than intended.
The issue is especially bad if the Magento installation has a high number of stores, customer groups or both.

Versions Affected:

  • 2.11.0 - 2.11.2
  • 3.3.0 - 3.3.4

RCA

Mview was added to replace the previously added custom database triggers that would occasionally be deleted by Magento during indexing. Mview was observing index tables for price and stock.
When a price was indexed it would add entries for each store and customer group combination e.g. 10 stores, 10 customer groups, 100 entries for one product. This can quickly become very large.

Fix Released

Change Mview to observe the entity tables rather than index tables. Results in only one entry per product rather than the 100 from the previous example. Released in 2.12.2 and 3.4.2.

Solution

Upgrade to Klevu version 2.12.2 or 3.4.2 at least, preferably the latest version of 2.x / 3.x

Compatibility with OpenSearch 2.4

Hi,
We run latest klevu on Magento 2.4.6 and opensearch 2.4, search result page doesn't return any results but it works once klevu modules are removed. Could maybe someone confirm compatibility with Magento 2.4.6 and OpenSearch 2.4?
Many thanks,
Piotr

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.