Skip to content
This repository has been archived by the owner on May 28, 2023. It is now read-only.

Elastic 7 Search support #342

Merged
merged 36 commits into from
Nov 25, 2019
Merged

Elastic 7 Search support #342

merged 36 commits into from
Nov 25, 2019

Conversation

pkarw
Copy link
Contributor

@pkarw pkarw commented Sep 13, 2019

I've added PoC for Elastic Search 7 support. By default still Elastic 5 is in use.

To start Elastic7:

 docker-compose -f docker-compose.elastic7.yml up

Then, you should re-import the data using mage2vuestorefront

TODO:

  • - add support for legacy Elastic5 queries (we need to have multiple elastic clients imported)
  • check the httpAuth - how to replace it with the new client
  • extract the elastic client connectivity logic to the single helper,
  • test the backward compatibility mode with Elastic5
  • test yarn migrate; yarn restore
  • update graphQL resolvers to new client's API
  • update docs regarding: how to migrate to ES7, the now missing seo tool
  • api/catalog.js to use the proper helpers
  • mage2vs tests on Elastic 5
  • check the DSL query diferences ES5 vs ES7

- The `db` context object - passed to every api endpoint now has two usefull methods: `getElasticClient` and `getRedisClient` for accesing the data stores - @pkarw (#328)
- The `lib/utils` got two new methods `getStoreCode(req: Express.Request)` and `getStoreView(code: string)` for getting the current multistore context from `vue-storefront` frontend requests - @pkarw
- The way Elastic and Redis clients have been fixed and code duplication removed across the app - @pkarw (#327)
@pkarw pkarw changed the base branch from master to develop September 13, 2019 23:04
@pkarw pkarw mentioned this pull request Sep 15, 2019
@pkarw
Copy link
Contributor Author

pkarw commented Sep 17, 2019

@ResuBaka
Copy link
Collaborator

@pkarw

Do you know if there is some work to be done on the magento modules so they work with ES 6/7?

@pkarw
Copy link
Contributor Author

pkarw commented Sep 20, 2019

Will be planned @ResuBaka

@pkarw pkarw changed the title [WIP] Elastic 7 Search support Elastic 7 Search support Sep 20, 2019
@pkarw
Copy link
Contributor Author

pkarw commented Sep 20, 2019

Test scenarios:

Test Elastic 7 Support

  • start docker docker-compose -f docker-compose.elastic7.yml up
  • set the config.elasticsearch.apiVersion=7.1 + config.storeViews.*.elasticsearch.apiVersion=7.1 in the vue-storefront-api
  • yarn db7 new
  • yarn restore7
  • yarn restore7_it
  • yarn restore7_de
  • yarn db rebuild
  • rm var/catalog*.json
  • yarn db dump7
  • yarn db dump7_it
  • yarn db dump7_de
  • run the Vue Storefront; browse products; check multistore
  • download mage2vuestorefront -> https://github.com/DivanteLtd/mage2vuestorefront, set the config.js:elasticsearch:apiVersion=7.1 and check the test_fullreindex.sh

Test Elastic 5.6 Compatibility Mode

  • start docker docker-compose up
  • set the config.elasticsearch.apiVersion=5.6 + config.storeViews.*.elasticsearch.apiVersion=5.6 in the vue-storefront-api
  • yarn db new
  • yarn restore
  • yarn restore_it
  • yarn restore_de
  • yarn db rebuild
  • run the Vue Storefront; browse products; check multistore
  • download mage2vuestorefront -> https://github.com/DivanteLtd/mage2vuestorefront, set the config.js:elasticsearch:apiVersion=5.6 and check the test_fullreindex.sh
  • check the yarn installer - for the install process

@pkarw
Copy link
Contributor Author

pkarw commented Sep 20, 2019

I need some help with testing this one out

@patzick @ResuBaka @alinadivante @lukeromanowicz @andrzejewsky

your support would be much appreciated!

@pkarw
Copy link
Contributor Author

pkarw commented Sep 20, 2019

The last thing to-do is to fix the graphql resolvers + apply the DSL query fix -> vuestorefront/vue-storefront#3586 to queryBuilder.js

@ResuBaka
Copy link
Collaborator

@pkarw I would test it but I have no running M2 and I have zero expertise in m2 so when I wanted to test it I needed to work on m1 native indexer so it would first work with es6/7 but there I don't know how long that would take.

@pkarw
Copy link
Contributor Author

pkarw commented Sep 24, 2019

@andrzejewsky I've noted one issue in the frontend: https://www.dropbox.com/s/20jmn0yiks5eofu/Screenshot%202019-09-24%2011.40.28.png?dl=0

it's because of the resp.totals the object got changed: https://www.dropbox.com/s/bxt1lkp5z8ip5oa/Screenshot%202019-09-24%2011.42.15.png?dl=0

We should fix it in VSF - supporting both: numeric, object totals format in the quickSearchByQuery: https://github.com/DivanteLtd/vue-storefront/blob/ac72a07a489bfb4e040c088315cb338d7408097d/core/lib/search.ts#L98

Anyway - more tests on VSF frontend as well are required

@pkarw
Copy link
Contributor Author

pkarw commented Sep 24, 2019

gotcha! Agata will update indexers after 6th of October as she's fully booked before - if you find some time you can still update the indexers to support ES7 (the key change is to index to different indexes per entity) :)

@andrzejewsky andrzejewsky merged commit 40b5bcb into develop Nov 25, 2019
@Wysselbie
Copy link

Wysselbie commented Feb 4, 2021

Hey guys,
I just wanted to know, if this is still "marked as experimental".

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants