Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Elasticsearch + Symfony @ SymfonyLive Online Polish Edition 2021

Elasticsearch + Symfony @ SymfonyLive Online Polish Edition 2021

Elasticsearch to najpopularniejsza wyszukiwarka pełnotekstowa o potężnych możliwościach. Jako programista PHP z kilkunastoletnim stażem, a obecnie pracownik Elastic (twórców Elasticsearch) chciałbym się z Wami podzielić najlepszym z obu światów.

9a328142924c93e5e148c75356ba6d42?s=128

Sebastian Grodzicki

March 12, 2021
Tweet

Transcript

  1. +

  2. $ whoami Sebastian Grodzicki 
 • Senior Engineering Manager at

    • ex-CTO at GoldenLine & SHOWROOM • SensioLabs Certi fi ed Symfony Developer @sebgrodzicki
  3. Elastic Stack

  4. None
  5. Vanilla PHP

  6. O ffi cial low-level client for Elasticsearch • O ffi

    cial PHP client for Elasticsearch: elastic/elasticsearch-php • Updated and released with the Elastic Stack version • Uses connection pool for cluster con fi guration • Exposes the Elasticsearch APIs using functions of a Client class • Each function returns the body of a HTTP response from Elasticsearch or a boolean value for HEAD API (e.g., Index exists API)
  7. O ffi cial low-level client for Elasticsearch

  8. . . Semantic Versioning 7 11 1 major minor patch

  9. O ffi cial low-level client for Elasticsearch

  10. O ffi cial low-level client for Elasticsearch

  11. O ffi cial low-level client for Elasticsearch

  12. Elastica • Community-driven PHP client for Elasticsearch: ru fl in/

    Elastica • Built on top of o ffi cial low-level client • Object-oriented instead of using associative arrays
  13. Elastica

  14. Elastica

  15. FOSElasticaBundle • Integrates the Elastica library into a Symfony environment

    • Use JmsSerializer or Symfony Serializer to convert between PHP objects and Elasticsearch data • Index con fi guration for Elasticsearch, or send data without con fi guration to use the dynamic mapping feature of Elasticsearch • Listeners for Doctrine events for automatic indexing
  16. FOSElasticaBundle Elasticsearch 7.x

  17. FOSElasticaBundle

  18. FOSElasticaBundle

  19. FOSElasticaBundle

  20. None
  21. Demo

  22. None
  23. Controller

  24. Doctrine entity class

  25. Data fi xtures

  26. Elasticsearch index con fi guration

  27. Aliased Indexes

  28. Aliased Indexes • talk_2021-02-26-182155 • talk_2021-03-12-104500 • talk_2021-03-12-112000 ← talk

  29. Mappings

  30. Populating

  31. Searching via CLI

  32. Searching via controller

  33. Autowiring

  34. Searching for "Sebastian"

  35. Searching for "Symfony"

  36. Searching for "Kuba"

  37. Searching for "Jakub"

  38. Synonyms

  39. Searching for "Jakub"

  40. Kuba != Kuba

  41. Tajemnica turkusowego łabędzia

  42. Tajemnica turkusowego łabędzia

  43. Tajemnica turkusowego łabędzia

  44. Tajemnica turkusowego łabędzia

  45. Tajemnica turkusowego łabędzia

  46. Tajemnica turkusowego łabędzia

  47. Tajemnica turkusowego łabędzia

  48. Morfologik Polish Lemmatizer plugin for Elasticsearch

  49. Morfologik Polish Lemmatizer plugin for Elasticsearch

  50. Morfologik Polish Lemmatizer plugin for Elasticsearch

  51. Hosting

  52. Docker

  53. SymfonyCloud Latest is 7.11

  54. Elastic Cloud

  55. Want more?

  56. Elastic Logs

  57. Elastic Metrics

  58. Elastic APM

  59. Q&A

  60. Thank you!