elasticsuite: Search Usage Analytics - tracking_log_session index does not exist yet - 2.11.1
I have seen a previously raised issue regarding this, however the issue that I am having can be traced to an error in the indexing.
The elasticsuite_tracker_log_event table is being populated with front end visit information as expected, the cronjob is being attempted, but fails with the following error in the cron log:
main.ERROR: Cron Job elasticsuite_index_log_event has an error: Warning: Undefined array key “date” in /html/vendor/smile/elasticsuite/src/module-elasticsuite-tracker/Model/EventIndex.php on line 79.
Which is the line:
$date = substr($event['date'], 0, 7);
From this function:
public function indexEvents($events)
{
$bulk = $this->indexOperation->createBulk();
$indices = [];
foreach ($events as $event) {
if (isset($event['page']['store_id'])) {
$date = substr($event['date'], 0, 7);
$index = $this->indexResolver->getIndex(self::INDEX_IDENTIFIER, $event['page']['store_id'], $date);
if ($index !== null) {
$event = $this->mappingEnforcer->enforce($index, $event);
$indices[$index->getName()] = $index;
$bulk->addDocument($index, $event['event_id'], $event);
}
}
}
if ($bulk->isEmpty() === false) {
$this->indexOperation->executeBulk($bulk);
}
foreach ($indices as $index) {
$this->indexOperation->refreshIndex($index);
}
}
This in turn makes the cron job fail and the index never appear.
Magento Version : 2.4.6 ElasticSuite Version : 2.11.1 Environment : Developer Elasticsearch 7.17
Third party modules : Mirasvit Cache Warmer BSS Commerce Out of stock Notification BSS Commerce B2B Registration BSS Commerce Hide Price Xtento Product Feed Export Module
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 1
- Comments: 24
Commits related to this issue
- Fix #2913, undefined array key date for elasticsuite tracker event index — committed to vahonc/elasticsuite by vahonc a year ago
- Fix #2913, PHPCS warning — committed to vahonc/elasticsuite by vahonc a year ago
- Merge pull request #2923 from vahonc/2913-elasticsuite-tracker-event-index-date-2.11-fix Fix #2913, undefined array key "date" for elasticsuite tracker event index — committed to Smile-SA/elasticsuite by romainruaud a year ago
- Fix #2913, undefined array key date for elasticsuite tracker event index — committed to rbayet/elasticsuite by vahonc a year ago
- Fix #2913, undefined array key date for elasticsuite tracker event index — committed to rbayet/elasticsuite by vahonc a year ago
- Merge pull request #3112 from rbayet/feat-tracker-backport-db-schema-date Fix #2913, undefined array key date for elasticsuite tracker event index — committed to Smile-SA/elasticsuite by rbayet 8 months ago
I tagged a 2.11.1.1
Thank you everyone
@vahonc excellent thanks, I’ll create a patch and test it out
Can’t catch them all, but as long as you are aware that half the battle dealt with.
Are you using Fastly ? If yes, check this page : https://github.com/Smile-SA/elasticsuite/wiki/FAQ#im-using-fastly-and-i-cant-see-anything-on-the-elasticsuite--search-usage-dashboard