Building Elasticsearch Index in Mayocat

18 views
Skip to first unread message

Amal Saha

unread,
Jan 21, 2016, 4:23:21 AM1/21/16
to mayocat-users
Hi,

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




Jerome Velociter

unread,
Jan 22, 2016, 3:31:21 AM1/22/16
to Amal Saha, mayocat-users
Hello Amal,

Yes, right now the tasks that builds the whole index has to be triggered manually. I think the idea was that with incremental indexing you wouldn't have to do that automatically at startup (since it can be a costy operations if you have a lot of products).
But if you extend mayocat, you can always do it this way, I think there's no harm here.
Note that right now in mayocat the ES index is not really used ; even the plain text searches are done using Postgres directly.

Hope this helps,

Regards,
Jerome

--
You received this message because you are subscribed to the Google Groups "mayocat-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mayocat-user...@googlegroups.com.
To post to this group, send email to mayoca...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mayocat-users/8e6ad952-23df-4470-94fe-6ca31d9cf588%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Amal Saha

unread,
Jan 22, 2016, 3:36:10 AM1/22/16
to mayocat-users
Thanks, Jerome. It was very helpful. 

Thanks and Regards,
Amal   


----
Reply all
Reply to author
Forward
0 new messages