Smile-SA / smile-magento-elasticsearch

Magento ElasticSearch Implementation
151 stars 90 forks source link

How to search multiple language across stores. #120

Closed voldedore closed 6 years ago

voldedore commented 6 years ago

This module increases significantly search performance and results. But it seems not to provide multiple languages search across stores.

For example: we have a product 001 named

The scenario that we want to provide to our users: For each of the following keywords and in any store (store_id = any), users should get a results containing product 001.

  1. Keyword Philips elsa
  2. Keyword 可愛小夜燈
  3. Keyword SoftPal Elsa
  4. Et cetera...

But actually users just get:

  1. At store_id = 1 (en), keyword Philips elsa --> OK
  2. At store_id = 2 (hk), keyword 可愛小夜燈 --> OK
  3. At store_id = 1 (en), keyword 可愛小夜燈 --> NG (should be OK)

I've read lots about documentation and dive into this module code, then the "fields" in the _buildFulltextQuery function only contain the field_zh when the request is from store 2, and field_en for store 1.

Am I missing any configuration to enable multistore search ? Or we have to develop more about this feature ?

voldedore commented 6 years ago

Actually I've got this fixed by

  1. Rewrite main reindexing functionality to get all stored-scope attributes on the same document, change id from {id_storeid} to {id}...
  2. Rewrite main query processing functionality not to search from a specific store attribute but at all stores at the same time.

Thanks for making this work. Btw, I created a docker image for all linux-related installation of ElasticSearch engine here, if someone has some interest.

I think this should be closed now. Thanks.

Regards,

Vinh