vuestorefront / magento2-vsbridge-indexer

This is official Vue Storefront, native, Magento2 indexer
https://vuestorefront.io
MIT License
69 stars 89 forks source link

How to build Custom index extension #235

Open rain2o opened 4 years ago

rain2o commented 4 years ago

Feature Request

It would be helpful to have both (or at least one of) a Boilerplate M2 extension and/or a tutorial/documentation on how to build an extension to this module for indexing custom data.

For example, we have some custom entities that we would like to index into VSF ES. I have built a couple modules to do this already, but it involved a lot of comparing the different pieces of this module and testing a few different approaches. It would be nice to have a starting point with a boilerplate, or at least some sort of documentation to walk through the different pieces of the module - what the required pieces are, how they work, etc...

kkdg commented 4 years ago

The docs for this topic is done, it's under review, once review is done, you will be handed to with it. Thanks :) @rain2o

afirlejczyk commented 4 years ago

Hi @rain2o
which cases are you particular interested: a) add new type to ES b) extending exported data to ES for existing types? (product, category, etc)

Or both?

I did quite a lot modification in both cases and adding sample module for extending default functionality is in my mind for quite some time.. ;)

rain2o commented 4 years ago

Hi @kkdg , thanks for the update! Looking forward to seeing the docs for this.

@afirlejczyk well, both in fact. But scenario A of building new types into ES is probably the more interesting one to me at the moment. I have had to build both scenarios a few times, but I'd say creating a new type for ES was a little less straight-forward than extending existing.

anupwankhede commented 4 years ago

Hi @afirlejczyk
Could you please let us know the timeline on sample module for extending default functionality as you mentioned earlier here?

@kkdg , is the doc ready for see now?

Thanks both

afirlejczyk commented 4 years ago

Hi @anupwankhede If you wish to extend some data exported for existing types, you can check this PR: https://github.com/DivanteLtd/magento2-vsbridge-indexer/pull/258

There is a separate module which exports extra data for downloadable products.

anupwankhede commented 4 years ago

Thanks @afirlejczyk for quick reply. Much appreciated. We will be using this definitely in our project.

However, our immediate need is for separate types, where we want to export the configuration of some custom modules which will affect content on FE pages. Do you have something to share for the same? Thanks

afirlejczyk commented 4 years ago

Recently new type was added: https://github.com/DivanteLtd/magento2-vsbridge-indexer/pull/286

so it can give an idea of what has to be done. You can also take a look at the vsbridge cms page, tax rule or review indexer.

anupwankhede commented 4 years ago

awesome work @afirlejczyk . Cheers mate.

anupwankhede commented 4 years ago

Hi @afirlejczyk , on bit different note, can you please let me know if custom_layout_update XML field is usable in vue-storefront, so that we can see respective content in same manner as it shows on Magento FE?

anupwankhede commented 4 years ago

Hi @afirlejczyk , We have created new index type to push core-config-data table & its running fine on reindexing in Magento. We are new to Vue SF development and not have much idea about what steps are involved in configuring this new index type in Vue SF & how to read this new index type in Vue FE.

We tried to check mapping on below URLs but getting connection refused error as below: → curl -XGET 'https://xxxx-magento2.local.com:3000/_mapping?pretty=true' curl: (7) Failed to connect to xxxx-magento2.local.com port 3000: Connection refused

→ curl -XGET 'https://xxxx-magento2.local.com:9200/_mapping?pretty=true' curl: (7) Failed to connect to xxxx-magento2.local.com port 9200: Connection refused

Can you please let us know how should we proceed further on this?

Thanks in advance.

afirlejczyk commented 4 years ago

Hi, I am not involved in VSF development, so I think you should ask them: on slack or forum. That might be helpful: https://docs.vuestorefront.io/guide/data/entity-types.html