klevu / productsearch Goto Github PK
View Code? Open in Web Editor NEWKlevu Smart Search Module for Magento 2
Klevu Smart Search Module for Magento 2
It seems that there's a bug in Klevu\Search\Model\Product\Product::getCategoryPaths
, it's using getIsExcludedCat but it probably should be getIsExcludeCat as category attribute code is is_exclude_cat
.
Change was introduced in this commit.
The command klevu:syncdata
states it will sync even CMS pages too,
productsearch/Console/Command/SyncCommand.php
Line 128 in 8dab5ea
but apparently CMS data won't be synced via this command, because that part is commented out:
productsearch/Console/Command/SyncCommand.php
Line 250 in 8dab5ea
I suggest to remove the CMS from the description or put back the commented out CMS synchronisation call.
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.
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 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.
Hi,
The following method is not handling "elasticsearch6" as the value for catalog/search/engine
config key, which causes the query to be done against terms entity_id
and renders no results.
Thanks
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
productsearch/Model/Api/Response.php
Line 132 in e6f9b41
In the called helper method the store configuration is loaded via the config data collection.
Line 489 in e6f9b41
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
productsearch/Model/Api/Response.php
Line 139 in e6f9b41
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.
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
productsearch/Model/Api/Request.php
Line 61 in 8dab5ea
Sample use of Zend\Http classes
There is a trailing slash in one of the cron schedule options which causes an error.
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
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" ] ];
There are a few usages of the old \Zend\Log\Logger still instead of being replaced by the Klevu LoggerConstants:
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.
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[]
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?
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
Warning: array_multisort(): Array sizes are inconsistent in vendor/klevu/module-productsearch/Plugin/Api/Search/SearchResult.php on line 59
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
$key
is initialized to 0 outside the for loop
Compilation within Magento 2.2 fails due to productsearch/Controller/Adminhtml/Download/Logdownload.php being corrupt in version 2.2.23
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
productsearch/Model/Product/LoadAttribute.php
Line 392 in 6046055
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
The debug log line introduced in this commit 29923fb#diff-2a454ebaf251d940453b8e1381cd1206R54 and released in version 2.3.7 is potentially site-breaking.
Using print_r
on the $result
object can (and did) lead to memory_limit issues at checkout. For reference the memory_limit on prod is 1.3GB so it's not misconfigured.
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:
catalogrule_product
to run by schedule
bin/magento indexer:set-mode schedule catalogrule_product
catalogrule_product
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
.
Right now, there's no indication of the progress. Perhaps it would be helpful if there was a percentage progress available or at the very least, an indication of how many requests have run.
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.
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.
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.
Upgrade to Klevu version 2.12.2 or 3.4.2 at least, preferably the latest version of 2.x / 3.x
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.