You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I save a product in Craft Commerce, the Algolia index is not updated. When I run a ./craft scout/index/refresh dev_products command the index is however updated.
Not sure when this happened, but possibly during one of the latest updates I did to this Craft instance. Running latest Craft, Commerce and Scout.
Defining indices thus:
'indices' => (new SitemoduleServiceService)->getIndicies()
public function getIndicies(){
$indicies = [];
// environment always dev unless in production. So localdev, dev and stg becomes dev
$env = "dev";
if (getenv('ENVIRONMENT') == "prod") $env = "prod";
// todo: add site 6 for Products and Product Families
// products only relevant for site 5:
$indicies[] =
\rias\scout\ScoutIndex::create("{$env}_products")
->elementType(\craft\commerce\elements\Product::class)
->criteria(function (\craft\commerce\elements\db\ProductQuery $query) use ($site, $productType) {
$query->siteId = 5; // $site->id;
return $query;
})
->transformer(function (\craft\commerce\elements\Product $product) {
return $this->transformProductData($product);
});
// product families only relevant for site 5:
$indicies[] =
\rias\scout\ScoutIndex::create("{$env}_product_families")
->elementType(\craft\elements\Category::class)
->criteria(function (\craft\elements\db\CategoryQuery $query) use ($site, $productType) {
$query->siteId = 5; // $site->id;
$query->group("productFamily");
return $query;
})
->transformer(function (\craft\elements\Category $category) {
return $this->transformCategoryData($category);
});
// entries on each site
foreach (Craft::$app->getSites()->getAllSites() as $site) {
$indicies[] =
\rias\scout\ScoutIndex::create("{$env}_{$site->handle}_entries")
->elementType(\craft\elements\Entry::class)
->criteria(function (\craft\elements\db\EntryQuery $query) use ($site) {
$query->siteId = $site->id;
// exclude a couple of section types
$query->section("and, not people, not locations, not categoryIndex");
return $query;
})
->transformer(function (\craft\elements\Entry $entry) {
return $this->transformEntryData($entry);
});
}
return $indicies;
}
Wondering whether it has something to do with me disabling a queue runner that was acting up after I had dome some updates to Craft
The text was updated successfully, but these errors were encountered:
Hey @nitech, could you confirm that site 5 is not your primary site and wether or not your are running with the queue option enabled?
And can you check if refreshing the index through the utility updates the product?
(this feels related to #266 but I'll leave this open for now)
When I save a product in Craft Commerce, the Algolia index is not updated. When I run a
./craft scout/index/refresh dev_products
command the index is however updated.Not sure when this happened, but possibly during one of the latest updates I did to this Craft instance. Running latest Craft, Commerce and Scout.
Defining indices thus:
'indices' => (new SitemoduleServiceService)->getIndicies()
Wondering whether it has something to do with me disabling a queue runner that was acting up after I had dome some updates to Craft
The text was updated successfully, but these errors were encountered: