3

I am new to Magento. I have a custom module in Magento 2 that has a table with data and CRUD models. I want to create an indexer for it to be able to push it to Elasticsearch.

I already created the indexer.xml and mview.xml files, as well as class inside the Model\Indexer namespace. Here it is:

namespace VendorName\Faq\Model\Indexer;

class Question implements \Magento\Framework\Indexer\ActionInterface, \Magento\Framework\Mview\ActionInterface
{
  public function execute($ids) {
    // ???
  }

  public function executeFull() {
    // ???
  }

  public function executeList(array $ids) {
    // ???
  }

  public function executeRow($id0 {
    // ???
  }
}

The official documentation has nothing to tell about how to get data for indexing - it only has a structure for the Indexer class.

Any suggestions, please?

1 Answer 1

0

In simple words, Index is a data structure that helps to improve the performance of data searches and queries on a table.

Steps to create custom index

https://dolphinwebsolution.com/how-to-create-custom-indexer-in-magento-2/

1
  • Comment below doesn't explain model functions functionalities. Commented Oct 17 at 19:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.