QuestionQ3

Customize Commerce features

An Adobe Commerce Architect creates an Italian-locale stopword named stopwordsJtJT.csv and changes the stopword directory to:

<magento_root>/app/code/CustomVendor/Elasticsearch/etc/stopwords/

What is the correct way to change the stopwords directory within the custom module?

  • A Add stopwords to the stopwordsDirectory and CustomVendor_Elasticsearch to the stopwordsModule parameter of the \Magento\Elasticsearch\SearchAdapter\Query\Preprocessor\Stopwords class via di.xml
  • B Add a new class implementing \Magento\Framework\Setup\Patch\PatchInterface to modify the default Value of elasticsearch\custom\stopwordspath in core_config_data table.
  • C Add stopwords to the stopwordsDirectory parameter of the \Magento\Elasticsearch\Model\Adapter\Document\DirectoryBuilder class via stopwords/it.xml and Adobe Commerce will automatically detect the current module.
Explanation

Adobe Commerce configures custom-module stopwords through etc/di.xml for \Magento\Elasticsearch\SearchAdapter\Query\Preprocessor\Stopwords. Set stopwordsModule to CustomVendor_Elasticsearch and stopwordsDirectory to stopwords; the module-relative directory resolves to etc/stopwords, where the locale CSV file belongs.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!