Closed goddas closed 3 years ago
The issue was due to PhpStorm. Resolves by restarting it, but happens consistently.
Steps to reproduce:
1) php artisan scout:reimport
with a toSearchableArray()
on the model
2) modify the toSearchableArray()
function
3) run php artisan scout:reimport
again, the modifications are ignored. Never noticed this behaviour with PhpStorm, not sure if this is package related?
Hey @goddas , thank you for reporting this issue. I've tried to reproduce the issue you're describing, but without any luck.
Given that the errors seems to be that modifications don't get taken into account, my best guess is that it's related to PhpStorm, and not to Scout Extended. Did you try reproducing this in another editor as well?
The problem was due to me not restarting the laravel queue worker, so it wasn't using the new changes.
Please let me know what might be causing the following behavior. I'm on Laravel 8 (migrated from 7 ) if that makes a difference.
So I have pretty much a brand new
laravel/scout
andalgolia/scout-extended
install. The later gives me trouble. Scout withoutalgolia/scout-extended
works fine.Issue: When I run
scout:import
orscout:reimport
1) The index gets created at algolia, but the index is run through
toSearchableArray()
function which I have deleted! So I've had this function to experiment with scout, but it seems like my indexing is now stuck in this function even though it is commented-out/deleted. If I change values in DB, they appear correctly in the index, run through the phantomtoSearchableArray()
.2) I get the following error trying to get results:
Algolia\ScoutExtended\Exceptions\ShouldReimportSearchableException ObjectID seems invalid. You may need to re-import your data using the
scout-reimportArtisan command.
Here is what I composer installed (in that order):
laravel/scout
algolia/algoliasearch-client-php
algolia/scout-extended
I've tried:
php artisan cache:clear
php artisan route:clear
php artisan config:cache
composer dump-autoload
Currently, the only searchable model does not override any scout methods, it just has the
Searchable
trait. If I uninstallscout-extended
, everything works right away without reindexing or anything like that.Help is much appreciated.