studioespresso / craft-scout

Craft Scout provides a simple solution for adding full-text search to your entries. Scout will automatically keep your search indexes in sync with your entries.
MIT License
81 stars 54 forks source link

Fix: Deindex elements that get set to 'disabled' #270

Closed Numkil closed 1 year ago

Numkil commented 1 year ago

In heromd users were confused when they would 'disable' an element without fully deleting it and it would not be removed from algolia search results.

janhenckens commented 1 year ago

I can only reproduce this when save in a not-primary site so this could be related to #266. Will investigate further!

janhenckens commented 1 year ago

Did some digging to see where the plugin checks if disabled elements should be removed and that happens is this function https://github.com/studioespresso/craft-scout/blob/master/src/behaviors/SearchableBehavior.php#L80 - the element int question won't match the criteria and thus will be removed.

Only in this case the searchable behaviour probably doesn't get fired, due to the issue in #266