Tim Kelty

Results 323 comments of Tim Kelty

@twosixcode can you post your whole scout.php file? or at least the full index we're talking about?

@twosixcode try something like this as a temporary workaround: ``` ->splitElementsOn(['anyField']) ->transformer(function (\craft\elements\Entry $entry) { return [ 'objectID' => $entry->id .'-'. $entry->locale, 'distinctID' => $entry->id, ]; }) ->indexSettings( \rias\scout\IndexSettings::create() ->attributesForFaceting(['distinctID'])...

I don't see `splitElementsOn`…Did you try it with `->splitElementsOn(['anyField'])` like in my example? > $entry-id is not really distinct across all sites I realize this, but when scout deletes things,...

Yeah try deleting, with `splitElementsOn` in place, as well as all the other stuff. Maybe try splitElementsOn with an actual field handle you have. At any rate, it would just...

@twosixcode otherwise, adding something like this should serve as a workaround for the deletion bit: ```php Event::on( \craft\services\Elements::class, \craft\services\Elements::EVENT_AFTER_DELETE_ELEMENT, function (\craft\events\ElementEvent $event) { $element = $event->element; $index = Craft::$container->get(\Algolia\AlgoliaSearch\SearchClient::class)->initIndex('yourIndexName'); $objectIDs...

@weotch that seems like it would be problematic for large indexes, where batching is required due to the request size limits.

Yup. This would be nice. FWIW, I do this kind of thing on a nightly cron using `partialUpdateObjects`. In this example I refresh a "random" property on every object, because...

Nope, just clarifying. That's exactly what I'm doing in my example above (I run `craft appmodule/randomize-index products` on a cron).

@davist11 can you test with this branch? Should be fixed. ``` "rias/craft-scout": "dev-97-multisite-single-index as 2.3.2", ``` You've got the right idea with including your site in you objectID. The issue...

whoops - use `dev-97-multisite-single-index`