scout-extended
scout-extended copied to clipboard
Reimporting aggregators only
- Laravel version: latest
- Algolia Scout Extended version: latest
- Algolia Client Version: latest
Description
With scout:reimport you can specify which searchable model you want to reimport. But if you have an aggregator called News for example you cannot say scout:reimport News, you get:
Class "News" not found
Steps To Reproduce
Make an aggregator Try to reimport aggregator only
Hi @mokhosh ,
Did you try passing the full classname (including namespace) to the command? For example, if your News aggregator lives in the default App\Search namespace:
php artisan scout:reimport "App\Search\News"
This should find the aggregator and reimport it. Let me know if it works for you 🙂
Thanks @DevinCodes for the response. It did work. I think it would be nice to have a config for aggregates folder that defaults to "app/Search" and we would look there too in addition to models folder when we're reimporting, so we don't need to explicitly indicate the namespace.
I would love to hear what others think of such an option before we decide to implement it 🙂 Let's discuss!
Hi all,
I'm running the reimport like this php artisan scout:reimport "App\Search\News" however, it only runs for the first class in the $models array.
What am I doing wrong?
Hi @srlbarron ,
Do all classes in your $models array implement the Searchable trait? If so, what happens if you change the order of your classes; does it still only import the first, or does it only import a specific class?
Thank you in advance!
Hi @DevinCodes, I got it solved and I honestly don't know what it was.
Possible causes:
- I was using a free account to test my stuff and it got quota'ed
- Running on laravel 6 with newer scout versions
- Lots of legacy custom code on my end (not my fault thought ;) )
Okay, great to hear it got solved! 😄
Happy coding @srlbarron