matchish / laravel-scout-elasticsearch

Search among multiple models with ElasticSearch and Laravel Scout
MIT License
702 stars 113 forks source link

Adaptive import #279

Closed DavisPuciriuss closed 3 months ago

DavisPuciriuss commented 3 months ago

Based on some performance testing (here), I have added an 'adaptive' import option. That will check if parallel import is 'worth it' in that case.

Useful when having multiple imports going, with varying document count. This is still a work in progress, would like your opinion if this is even something that should be added, or should just be kept under the same '--parallel' option.

Things to do: Check Queue::size of the parallel-import queues, if they are full or currently handling another import - disable parallel import. More performance testing, as the number of documents where parallel import is faster than regular could vary.