Save 37% off PRO during our Black Friday Sale! »

DynamoDBとElasticsearch Serviceを組み合わせて、簡単な全文検索を実装してみた話

4e523d3c4d6047382d22f61ebe53c554?s=47 ore88ore
June 16, 2020

DynamoDBとElasticsearch Serviceを組み合わせて、簡単な全文検索を実装してみた話

4e523d3c4d6047382d22f61ebe53c554?s=128

ore88ore

June 16, 2020
Tweet

Transcript

  1.  ࡔҪ༟հʢ!PSFPSFʣ %ZOBNP%#ͱ&MBTUJDTFBSDI4FSWJDFΛ૊Έ߹Θͤͯɺ ؆୯ͳશจݕࡧΛ࣮૷ͯ͠Έͨ࿩

  2. ηογϣϯ಺༰  αʔόʔϨεͳγεςϜͳͲͰσʔλͷอଘઌͱͯ͠ %ZOBNP%#Λར༻͍ͯ͠ΔγεςϜ͸਺ଟ͋͘Δͱࢥ͍· ͢ɻͦͷγεςϜʹશจݕࡧػೳ΍ͦͷଞͷ༷ʑͳݕࡧػೳΛ ࣮૷͠Α͏ͱͨ͠৔߹ɺ%ZOBNP%#͚ͩͰ͸ͳ͔ͳ͔࣮૷͕ ೉͍͠ͱࢥ͍·͢ɻ ͜ͷΑ͏ͳ৔߹ʹɺ&MBTUJDTFBSDI4FSWJDFΛ૊Έ߹Θͤ ͯɺ؆୯ͳશจݕࡧػೳΛ࣮૷ͯ͠Έͨࣄྫͷ࿈ܞ෦෼Λத৺ ʹ঺հ͠·͢ɻ

  3. ηογϣϯ಺༰  ✦ ηογϣϯͷର৅ऀ ✦ %ZOBNP%#Λར༻͍ͯͯ͠ݕࡧॲཧͰۤ࿑͍ͯ͠Δ ✦ &MBTUJDTFBSDI4FSWJDFΛ࢖ͬͨ͜ͱ͕ແ͍ɺ·ͨ͸γεςϜ ΁ͷ૊ΈࠐΈํ͕Θ͔Βͳ͍ ✦

    ͓࿩͠͠ͳ͍͜ͱ ✦ શจݕࡧࣗମͷ࢓૊Έ ✦ ֤छΫΤϦ౳ͷৄࡉͳ಺༰
  4. ࣗݾ঺հ  "84ࣄۀຊ෦ɹϓϩμΫτάϧʔϓ ιϑτ΢ΣΞ։ൃΤϯδχΞ 4BB4ϓϩμΫτͷاըɾ։ൃɾӡ༻ ࡔҪɹ༟հ!PSFPSF

  5. ΞδΣϯμ  ‣ %ZOBNP%#ͷݕࡧॲཧʹ͍ͭͯ ‣ &MBTUJDTFBSDI4FSWJDFͱͷ࿈ܞʹ͍ͭͯ ‣ ·ͱΊ

  6. ΞδΣϯμ  ‣ %ZOBNP%#ͷݕࡧॲཧʹ͍ͭͯ ‣ &MBTUJDTFBSDI4FSWJDFͱͷ࿈ܞʹ͍ͭͯ ‣ ·ͱΊ

  7.  DynamoDB ͬͯʁ

  8. %ZOBNP%#ͷ୅දతͳಛ௃  ✦ εέʔϧʹԠͨ͡ύϑΥʔϚϯε ✦ αʔόʔϨε ✦ ߴ͍Մ༻ੑͱ଱ٱੑ

  9.  DynamoDB ͬͯ࠷ڧʁ

  10.  DynamoDB ͬͯແఢʁ

  11. %ZOBNP%#Ͱσʔλݕࡧ  ✦ ςʔϒϧΛ݁߹ͯ͠ݕࡧ͢Δ͜ͱ͕Ͱ͖ͳ͍ ✦ Ωʔ߲໨Ҏ֎ͷ৚݅ͰߜΓࠐΉ৔߹͸ɺ શ݅औಘޙͷϑΟϧλϦϯάͱͳΔ ✦ ෦෼Ұகݕࡧ͕Ͱ͖ͳ͍

  12. %ZOBNP%#Ͱσʔλݕࡧ  ✦ ςʔϒϧΛ݁߹ͯ͠ݕࡧ͢Δ͜ͱ͕Ͱ͖ͳ͍ ✦ Ωʔ߲໨Ҏ֎ͷ৚݅ͰߜΓࠐΉ৔߹͸ɺ શ݅औಘޙͷϑΟϧλϦϯάͱͳΔ ✦ ෦෼Ұகݕࡧ͕Ͱ͖ͳ͍ ɹ'30.5BCMF

    ɹ*//&3+0*/5BCMF ɹ0/ɾɾɾ
  13. %ZOBNP%#Ͱσʔλݕࡧ  ✦ ςʔϒϧΛ݁߹ͯ͠ݕࡧ͢Δ͜ͱ͕Ͱ͖ͳ͍ ✦ Ωʔ߲໨Ҏ֎ͷ৚݅ͰߜΓࠐΉ৔߹͸ɺ શ݅औಘޙͷϑΟϧλϦϯάͱͳΔ ✦ ෦෼Ұகݕࡧ͕Ͱ͖ͳ͍ ɹ'30.5BCMF

    ɹ*//&3+0*/5BCMF ɹ0/ɾɾɾ ɹ8)&3& ɹɹ"UUSɾɾɾ ɹɹ"/%"UUSɾɾɾ
  14. %ZOBNP%#Ͱσʔλݕࡧ  ✦ ςʔϒϧΛ݁߹ͯ͠ݕࡧ͢Δ͜ͱ͕Ͱ͖ͳ͍ ✦ Ωʔ߲໨Ҏ֎ͷ৚݅ͰߜΓࠐΉ৔߹͸ɺ શ݅औಘޙͷϑΟϧλϦϯάͱͳΔ ✦ ෦෼Ұகݕࡧ͕Ͱ͖ͳ͍ ɹ'30.5BCMF

    ɹ*//&3+0*/5BCMF ɹ0/ɾɾɾ ɹ8)&3& ɹɹ"UUSɾɾɾ ɹɹ"/%"UUSɾɾɾ ɹ8)&3& ɹɹ"UUS-*,&`IPHF`
  15.  શจݕࡧ΍ͦͷଞͷ༷ʑͳݕࡧ Λ࣮૷͍ͨ͠

  16. ͲͷΑ͏ʹ࣮૷͢Δ͔ʁ  ͲͷΑ͏ʹ࣮૷͢Δʁ w ςʔϒϧͷઃܭΛ޻෉ͨ͠ΓɺΠϯσοΫεΛ ۦ࢖࣮ͯ͠૷͢Δʁ w σʔλΛશ݅औಘͯ͠ɺ͋ͱ͸ΞϓϦέʔγϣ ϯͰͳΜͱ͔͢Δʁ

  17.  ύϑΥʔϚϯεɺϦιʔεɾɾɾ

  18. ৽ͨͳαʔϏεΛ૊Έ߹ΘͤΔ  શจݕࡧΤϯδϯΛ૊Έ߹ΘͤͯΈΔ

  19. શจݕࡧΤϯδϯΛ૊Έ߹ΘͤͯΈΔ ৽ͨͳαʔϏεΛ૊Έ߹ΘͤΔ  IUUQTXXXFMBTUJDDPKQFMBTUJDTFBSDI

  20. &MBTUJDTFBSDIͱ͸ʁ  &MBTUJDTFBSDI͸ɺ༷ʑͳϢʔεέʔεΛղܾ͢ Δ෼ࢄܕ3&45GVMݕࡧ෼ੳΤϯδϯͰ͢ɻ ओͳಛ௃ͱͯ͠͸ɺ w ߴ଎ w ෼ࢄઃܭ w

    ෯޿͍ػೳ͕಺ଂ͞Ε͍ͯΔ ˞&MBTUJDTFBSDIͬͯʁ IUUQTXXXFMBTUJDDPKQXIBUJTFMBTUJDTFBSDI ΑΓҾ༻
  21. "NB[PO&MBTUJDTFBSDI4FSWJDF  ׬શϚωʔδυܕͰ҆શ͔ͭεέʔϥϒϧͳ&MBTUJDTFBSDIαʔϏε ˞"NB[PO&MBTUJDTFBSDI4FSWJDF IUUQTBXTBNB[PODPNKQFMBTUJDTFBSDITFSWJDF ΑΓҾ༻

  22. ΞδΣϯμ  ‣ %ZOBNP%#ͷݕࡧॲཧʹ͍ͭͯ ‣ &MBTUJDTFBSDI4FSWJDFͱͷ࿈ܞʹ͍ͭͯ ‣ ·ͱΊ

  23. طଘγεςϜ 

  24. طଘγεςϜʴ&MBTUJDTFBSDI4FSWJDF 

  25. ׬੒Πϝʔδ 

  26. ׬੒Πϝʔδ 

  27. ✦ ̍ͭͷςʔϒϧͷσʔλΛ̍ͭͷΠϯσοΫε ʹ࿈ܞ͢Δύλʔϯ ✦ ෳ਺ͷςʔϒϧͷσʔλΛ̍ͭͷΠϯσοΫε ʹ࿈ܞ͢Δύλʔϯ σʔλ࿈ܞʹ͍ͭͯ 

  28. γϯϓϧͳσʔλ࿈ܞ 

  29. γϯϓϧͳσʔλ࿈ܞ 

  30. γϯϓϧͳσʔλ࿈ܞ 

  31. γϯϓϧͳσʔλ࿈ܞ 

  32. γϯϓϧͳσʔλ࿈ܞ 

  33. গ͠ൃలͤͨ͞σʔλ࿈ܞ 

  34. গ͠ൃలͤͨ͞σʔλ࿈ܞ 

  35. গ͠ൃలͤͨ͞σʔλ࿈ܞ 

  36. গ͠ൃలͤͨ͞σʔλ࿈ܞ 

  37. গ͠ൃలͤͨ͞σʔλ࿈ܞ 

  38. গ͠ൃలͤͨ͞σʔλ࿈ܞ 

  39.  ෦ॺΛมߋͨ͠৔߹͸ʁ

  40. ෦ॺΛมߋͨ͠৔߹ͷσʔλ࿈ܞ  6QEBUF#Z2VFSZ"1*c&MBTUJDTFBSDI3FGFSFODF IUUQTXXXFMBTUJDDPHVJEFFOFMBTUJDTFBSDISFGFSFODFEPDTVQEBUFCZRVFSZIUNM

  41.  ࠓճ঺հ͍͍ͤͯͨͩͨ͞ख๏͕ ඞͣ͠΋ਖ਼͍͠ͱ͸ݶΓ·ͤΜ

  42. ׬੒Πϝʔδ 

  43. )551$MJFOU  )551$MJFOUΛར༻ͯ͠ɺ"1*Λ࣮ߦ͢Δ /PEFKTͷ৔߹ w ඪ४Ϟδϡʔϧ IUUQTOPEFKTPSHEJTUMBUFTUWYEPDTBQJIUUQIUNMIUUQ@IUUQ w BYJPT IUUQTHJUIVCDPNBYJPTBYJPT

  44. &MBTUJDTFBSDI$MJFOU  &MBTUJDTFBSDI$MJFOUΛར༻ͯ͠ɺ"1*Λ࣮ߦ͢Δ +BWB +BWBTDSJQU 1ZUIPO /&5౳ʹରԠ IUUQTXXXFMBTUJDDPHVJEFFOFMBTUJDTFBSDIDMJFOUJOEFYIUNM

  45. &MBTUJDTFBSDI$MJFOU  IUUQTXXXFMBTUJDDPHVJEFFOFMBTUJDTFBSDIDMJFOUKBWBTDSJQUBQJDVSSFOUJOUSPEVDUJPOIUNM

  46. ΞδΣϯμ  ‣ %ZOBNP%#ͷݕࡧॲཧʹ͍ͭͯ ‣ &MBTUJDTFBSDI4FSWJDFͱͷ࿈ܞʹ͍ͭͯ ‣ ·ͱΊ

  47. ·ͱΊ  ✦ ෳࡶͳݕࡧ͸ɺݕࡧ͕ಘҙͳαʔϏεʹ೚ͤΔ ✦ %ZOBNP%#ͱ&MBTUJDTFBSDI4FSWJDFؒͷ σʔλ࿈ܞ͸ɺ%ZOBNP%#4USFNTΛར༻͢ Δ ✦ શจݕࡧ࣮૷࣌͸ΫϥΠΞϯτϥΠϒϥϦ΋͋

    ΔΑ
  48.  ·ͣ͸࣮ࡍʹ΍ͬͯΈΑ͏ʂ IUUQTEFWDMBTTNFUIPEKQBSUJDMFTMPDBM FMBTUJDTFBSDIMBNCEB

  49. None