I have an instance of Mayocat platform. I have a query regarding its ignition with Elasticsearch. I understand that Mayocat uses Java API provided by Elasticsearch. Actually notify() call on ObservationManager instance ensures that the SearchEngineEventListener instance is invoked and the latter calls index() operation which is a ES Java API wrapper defined in class ElasticSearchSearchEngine. This explains, for example, updating a product guarantees reindexing.
That is really cool.
There is also another feature related to Elasticsearch integration and this is defined in org.mayocat.shop.marketplace.search.BuildIndexTask.
This is related to building index of all products and collections for all tenants (merchants).
I was expecting that the execute() method in this class would be invoked automatically at startup. But that does NOT happen. If we invoke
'http:<host>:8081/tasks/buildMarketplaceIndex' using HTTP POST with an empty JSON body, execute() method is actually invoked. That is, the invocation is NOT automatic.
Questions:
Q1: Operations defined in BuildIndexTask.execute() are crucial for building a "full" (not just incremental) index of all products at startup. Is it expected that the adopter of Mayocat makes necessary arrangement like writing shell script or Java code, for invoking this operation (e.g., calling 'http:<host>:8081/tasks/buildMarketplaceIndex' using HTTP POST with an empty JSON body)?
Thanks and Regards,
Amal
CTO, Cratuz Technology Private Limited