FriendsOfSymfony / FOSElasticaBundle

Elasticsearch PHP integration for your Symfony project using Elastica.
http://friendsofsymfony.github.io
MIT License
1.24k stars 795 forks source link

Show filtered object count during populate #1892

Closed bobvandevijver closed 1 year ago

bobvandevijver commented 2 years ago

With the current populate command output you are not given insight in the amount of filtered objects, and they are not used to advance the progress bar as well. Before #1891 this would result in the progress bar not being completed at all, but now it jumps to the end as it is being marked as completed.

I propose the following adjustment: register the amount of filtered objects into the PreInserObjectsEvent and forward to the PostInsertObjectsEvent. There is also a PostAsyncInsertObjectsEvent, but I believe that is not being used at (will open a dedicated MR for it #1893). With the data now available to the console logger, we can print the skipped/total object after the populating message, and adjust the progress bar total to show the amount of objects to be really inserted.

I expect test will fail with this change, but before I update them I would love to hear if this is a reasonable change!

Old output

https://user-images.githubusercontent.com/1835343/202022563-561b2bfe-749f-487a-8b33-cf9af9d5863e.mp4

New output

https://user-images.githubusercontent.com/1835343/202179821-67ee1dd7-b5b0-4a37-9f28-9cf4cb164470.mp4

bobvandevijver commented 1 year ago

@XWB Anything I can do for this to get merged?

XWB commented 1 year ago

👍

bobvandevijver commented 1 year ago

@XWB I would love to see a release coming soon :)

XWB commented 1 year ago

I'll make some time soon for a new release.