rubymonsters / speakerinnen_liste

International Women* Speaker Directory
https://speakerinnen.org
MIT License
75 stars 62 forks source link

update elasticsearch version #781

Closed zaziemo closed 3 years ago

zaziemo commented 5 years ago

to get rid of Hashie Mash warning and keep up with new development

tyranja commented 5 years ago

https://github.com/rubymonsters/speakerinnen_liste/pull/806

zaziemo commented 5 years ago
zaziemo commented 5 years ago

Some links: https://logz.io/blog/upgrade-elasticsearch-5/

"Download the latest version package Install Java 8 Stop es instance Install the new package Put the new configuration Remove logging.yml (if you have) Remove unused site plugin Monitor the log Release the beast" https://www.linkedin.com/pulse/upgrading-elasticsearch-2x-5x-gian-giovani

Breaking changes: https://www.elastic.co/guide/en/elasticsearch/reference/5.0/breaking-changes-5.0.html

zaziemo commented 5 years ago

Maybe this migration helper plugin can help as well: https://github.com/elastic/elasticsearch-migration/blob/master/README.asciidoc

zaziemo commented 5 years ago

https://mendab1e.github.io/dev/2019/03/09/how_not_to_integrate_elasticsearch_testing_with_rspec.html

zaziemo commented 5 years ago

https://gist.github.com/zaziemo/1c8f6ed25b17b4200f1f53068e79f905

zaziemo commented 4 years ago
zaziemo commented 4 years ago

Already did some work on this branch: https://github.com/rubymonsters/speakerinnen_liste/compare/mah-upgrade-elasticsearch

netagonen commented 4 years ago

Steps towards upgrade elastic search locally:

  1. Have production data on local machine
  2. Re-Index elasticsearch with new data
  3. Make sure website on localhost still works
  4. Upgrade elasticsearch server and API in the docker container - look at @zaziemo 's branch first: (links which might be useful for this step that @zaziemo referred to: https://www.elastic.co/upgrade_guide https://logz.io/blog/upgrade-elasticsearch-5/ https://www.linkedin.com/pulse/upgrading-elasticsearch-2x-5x-gian-giovani/ https://github.com/elastic/elasticsearch-migration/tree/2.x
  5. Upgrade elasticsearsch rail gems - look at @zaziemo 's branch first
  6. Test search on website (i.e number of results, autosuggestions) ->
  7. Look at changes at elasticsearch API and gems API (links that might be usefull: https://www.elastic.co/guide/en/elasticsearch/reference/5.0/breaking-changes-5.0.html https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-suggesters-completion.html)
  8. Fix search specs (look at @zaziemo list above). (link that might be useful: https://mendab1e.github.io/dev/2019/03/09/how_not_to_integrate_elasticsearch_testing_with_rspec.html)
  9. Upgrade elasticsearch server in production env (probably follow this guide: https://www.elastic.co/upgrade_guide)
netagonen commented 4 years ago

More links, might be helpful https://www.elastic.co/guide/en/elasticsearch/reference/5.0/breaking_50_suggester.html https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-suggesters-completion.html https://www.elastic.co/blog/strings-are-dead-long-live-strings https://asquera.de/blog/2018-01-24/elasticsearch-speakerinnen/ http://elasticsearch-cheatsheet.jolicode.com/ https://medium.com/@mourjo_sen/a-detailed-comparison-between-autocompletion-strategies-in-elasticsearch-66cb9e9c62c4 https://hackernoon.com/elasticsearch-using-completion-suggester-to-build-autocomplete-e9c120cf6d87 http://www.kadrmasconcepts.com/blog/2015/04/25/typeahead-js-elasticsearch-and-rails/

langjoh commented 4 years ago

@netagonen Hi Neta, about step 4 (Upgrade elasticsearch server and API in the docker container): I think all you have to do is to specify a later version of the elasticsearch image in the docker-compose.yml. At the moment it is image: elasticsearch:2.4.5 . Here you can find all available image versions: go to https://hub.docker.com/_/elasticsearch and then search under 'tags' for your preferred version.

netagonen commented 4 years ago

hi @zaziemo , see also PR #1091 . There is still more work to do. here is all what is done and what is left to do: First of all it was very helpful to read this post in order to understand the searchable.rb file

Upgrade:

  1. go to branch neta/upgrade-elastis-6.7 and pull
  2. run make setup make sure bundle install is done successfully
  3. run make dev, in the console run rake elasticsearch:import:all
  4. run make up or docker-compose up to see also logs
  5. go to local host:3000
    • website should works
    • search should work

Problems we encountered and how we handled them:

Questions and tasks left:

zaziemo commented 3 years ago

@netagonen @alonpeer concerning min_score

I think we need one - or probably some more tweaking with the tie_breaker or field weighs. Can you explain how the profiles in the search results are ordered? Is it after the scores?

I made tests with the following search terms: 1) for „Social Business“, being in :en

Localhost: 1.108 speakers examples for non matching profiles (for my understanding): http://localhost:3000/en/profiles/nina-mohimi http://localhost:3000/en/profiles/arlene-buehler http://localhost:3000/en/profiles/alexandra-grassler

Production: 388 speakers (but there are also some profiles I would not consider matching to the search terms)

2) „programmieren frauen“, being in :en

localhost: 541 examples for non matching profiles (for my understanding):: http://localhost:3000/en/profiles/anja-blodow http://localhost:3000/en/profiles/regula-simon http://localhost:3000/en/profiles/annika-peters

not really matching but cool to list it: http://localhost:3000/en/profiles/janina-tiedemann --> which is an argument for being not so strict with the matching terms

production: 159

zaziemo commented 3 years ago

@netagonen @alonpeer Concerning autosuggestions: Here I don't get the same autosuggestions as on production which is good, because currently the suggester seems to be buggy if not broken :(

I would say it works as expected.

The suggested terms seem to be sorted by a score. Do you know what this score is about?

zaziemo commented 3 years ago

Solution for 0 Matches --> I opened a new issue (#1098). I think this is out of the scope for this one here.

zaziemo commented 3 years ago

@netagonen concerning cities: I think it is good to have the cities not analyzed. I remember faintly that we had problems with people having a city name as their real name. Besides as the cities serve as filters they are already covered.

zaziemo commented 3 years ago

@netagonen concerning the HashWrapper. Do I get it right that we have to add it somehow? If we have to, we should do it. This was one of the reasons we wanted to update elasticsearch in the first place (we were annoyed by these warnings.)

alonpeer commented 3 years ago

Hi @zaziemo. I just checked, and the Hashie::Mash#key warnings appear on my localhost when I'm on the master branch, but no longer appear on the neta/upgrade-elastic-6.7 branch. 🎉

zaziemo commented 3 years ago

The country filtering does not work anymore.

To reproduce: 1) search for anything 2) click on one country in the most left column You get this view

Bildschirmfoto 2020-11-23 um 19 31 38

--> I found the problem and will fix it. The country parameter has to be downcased http://localhost:3000/de/topics?filter_countries=FR&search=frauen+programmieren