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

サクッと検索サーバを用意する

Aipa
October 10, 2023

 サクッと検索サーバを用意する

「ちゅらデータ×freee勉強会」でLTした内容です。
https://connpass.com/event/281604/

Aipa

October 10, 2023
Tweet

More Decks by Aipa

Other Decks in Technology

Transcript

  1. αΫοͱݕࡧαʔόΛ
    ༻ҙ͢Δ
    ͪΎΒσʔλºGSFFFษڧձ
    BJQBDPNNBOEFS!ٓ໺࿷Ӊ஍ധ

    View full-size slide

  2. ࣗݾ঺հ
    w ΞΠύʔୂ௕ͱ͍͍·͢ !BJQBDPNNBOEFS

    w ͏ͪͳʔΜͪΎͰ͢
    w $#DMPVEגࣜձࣾͰಇ͍͍ͯ·͢
    w ෺ྲྀۀքͰΠϊϕʔγϣϯىͨͯ͘͜͠೔ʑؤு͍ͬͯ·͢
    w ΈΜͳʹ͸໧͍ͬͯ·͕ͨ͠ɺΰδϥ͕޷͖Ͱ͢

    View full-size slide

  3. એ఻ࠓ౓΍Γ·͢ʂʢʣ
    IUUQT
    fl
    VUUFSPLJOBXBDPOOQBTTDPNFWFOU

    View full-size slide

  4. ࠓ೔࿩͢͜ͱ

    View full-size slide

  5. αΫοͱݕࡧαʔόΛ༻ҙ͍ͨ͠

    View full-size slide

  6. ݕࡧαʔόΛ༻ҙ͠Α͏ͱࢥͬͨͳΒ
    • ElasticSearch → ࠷௿3୆ߏ੒ͩͱʂʁαΫοͱ͸༻ҙͰ͖Ͷ͐


    • ·͊׳Ε͍ͯΔਓͳΒେৎ෉ͳͷ͔΋


    • ೔ຊޠݕࡧ͢Δ·Ͱͷઃఆ΍Βखॱ͕ͩΔ͍


    • Πέͯͦ͏ͳ΍ͭ࢖͏ʁϚωʔδυαʔϏεͱ͔


    • AlgoliaɺOpenSearchɺElastic Cloud


    • ͓͕͔͔ۚΔͷͰαΫοͱ͸͍͚ͳ͍


    • ᜛ٞਃ੥ͩΔ͍ʙʙʙʙʙʢฐࣾͷ৔߹ʣ


    • Զ͸ݕࡧ͕͍͚ͨͩ͠ͳΜͩʂʂʂʂʢݕࡧΠϯϑϥΛ͕Μ͹Δͱ͔͸ผʹ΍Γͨ͘ͳ͍ʣ

    View full-size slide

  7. ࠔͬͨͷͰ
    ΠϯλʔωοτͷւʹඈͼࠐΉ

    View full-size slide

  8. ͓ʁʁʁ
    https://voluntas.medium.com/
    %E3%82%AA%E3%83%B3%E3%83%A9%E3%82%A4%E3%83%B3%E3%83%89%E3%82%AD%E3%83%A5%E3%83%A1%E3%83%B3%E3%8
    3%88%E3%81%A8%E6%97%A5%E6%9C%AC%E8%AA%9E%E5%85%A8%E6%96%87%E6%A4%9C%E7%B4%A2-30cc38d7b1c3

    View full-size slide

  9. ྑͦ͞͏ͳ044ʹग़ձͬͨʂʂʂ

    View full-size slide

  10. .FJMJTFBSDIͱ͸
    w ʮΊ͍Γ͞ʔͪʯͱಡΉ
    w 3&45GVMͳݕࡧ"1*ɻதখن໛޲͚ͷݕࡧΤϯδϯͰ044
    w ϚωʔδυͳαʔϏε΋ఏڙ͍ͯ͠Δ
    w 3VTU੡Ͱඇৗʹߴ଎ʢϛϦඵ͙Β͍Ͱฦ͢ʣ
    w ଟݴޠରԠɻ೔ຊޠ΋αϙʔτʂʂ
    w ͍ΖΜͳϓϩάϥϛϯάݴޠͷ4%,͕༻ҙ͞Ε͍ͯΔ
    w %PDLFS*NBHF͕ఏڙ͞Ε͍ͯΔͷͰɺσϞఔ౓ͳΒ͙͢༻ҙͰ͖Δ

    View full-size slide

  11. αΫοͱ࢖ͬͯΈΔ

    View full-size slide

  12. αΫοͱ༻ҙ͢Δ·Ͱͷֶͼ
    w ࣮͸NBJOͷϦϙδτϦͩͱ೔ຊޠݕࡧ͕ม
    w ೖྗ͞ΕͨݕࡧΩʔϫʔυ͔ΒɺݴޠΛ൑அ͍ͯ͠Δ͕ɺ׽ࣈˍ
    Ωʔϫʔυ͕୹͍৔߹ɺதࠃޠͱ൑அ͞Εͯ͠·͏
    w ڧ੍తʹ೔ຊޠݕࡧ͢Δ%PDLFSJNBHF͕͋ΔͷͰɺࠓ͸͜ΕΛར
    ༻͠·͠ΐ͏

    View full-size slide

  13. αΫοͱ༻ҙ͢Δ·Ͱͷֶͼ
    w ࣮͸NBJOͷϦϙδτϦͩͱ೔ຊޠݕࡧ͕ม
    w ೖྗ͞ΕͨݕࡧΩʔϫʔυ͔ΒɺݴޠΛ൑அ͍ͯ͠Δ͕ɺ׽ࣈˍ
    Ωʔϫʔυ͕୹͍৔߹ɺதࠃޠͱ൑அ͞Εͯ͠·͏
    w ڧ੍తʹ೔ຊޠݕࡧ͢Δ%PDLFSJNBHF͕͋ΔͷͰɺࠓ͸͜ΕΛ
    ར༻͠·͠ΐ͏
    w IUUQTHJUIVCDPNNFJMJTFBSDINFJMJTFBSDIQVMM
    w WΛબ୒͠ͳ͍ͱʮͬʔʯͷจࣈ͕ೖΔͱύχοΫʹͳͬͯࢮ͵

    View full-size slide

  14. αΫοͱ༻ҙ͢Δ·Ͱͷֶͼ
    w ࣮͸NBJOͷϦϙδτϦͩͱ೔ຊޠݕࡧ͕ม
    w ೖྗ͞ΕͨݕࡧΩʔϫʔυ͔ΒɺݴޠΛ൑அ͍ͯ͠Δ͕ɺ׽ࣈˍ
    Ωʔϫʔυ͕୹͍৔߹ɺதࠃޠͱ൑அ͞Εͯ͠·͏
    w ڧ੍తʹ೔ຊޠݕࡧ͢Δ%PDLFSJNBHF͕͋ΔͷͰɺࠓ͸͜ΕΛ
    ར༻͠·͠ΐ͏
    w IUUQTHJUIVCDPNNFJMJTFBSDINFJMJTFBSDIQVMM
    w WΛબ୒͠ͳ͍ͱʮͬʔʯͷจࣈ͕ೖΔͱύχοΫʹͳͬͯࢮ͵
    https://github.com/PSeitz/wana_kana_rust/issues/13

    View full-size slide

  15. αΫοͱ༻ҙ͢Δ·Ͱͷֶͼ
    w ࣮͸NBJOͷϦϙδτϦͩͱ೔ຊޠݕࡧ͕ม
    w ೖྗ͞ΕͨݕࡧΩʔϫʔυ͔ΒɺݴޠΛ൑அ͍ͯ͠Δ͕ɺ׽ࣈˍ
    Ωʔϫʔυ͕୹͍৔߹ɺதࠃޠͱ൑அ͞Εͯ͠·͏
    w ڧ੍తʹ೔ຊޠݕࡧ͢Δ%PDLFSJNBHF͕͋ΔͷͰɺࠓ͸͜ΕΛ
    ར༻͠·͠ΐ͏
    w IUUQTHJUIVCDPNNFJMJTFBSDINFJMJTFBSDIQVMM
    w WΛબ୒͠ͳ͍ͱʮͬʔʯͷจࣈ͕ೖΔͱύχοΫʹͳͬͯࢮ͵
    https://github.com/PSeitz/wana_kana_rust/issues/13

    View full-size slide

  16. αΫοͱ༻ҙ͢Δ·Ͱͷֶͼ
    w ݕࡧ͍ͨ͠ϑΟʔϧυࢦఆ͸Ͱ͖Δ͕ɺݕࡧz࣌zʹ͸Ͱ͖ͳ͍
    w ࢦఆ͢Δ৔߹͸ΠϯσοΫεͷઃఆมߋʢߋ৽ʣ͕ඞཁ
    w ࠓޙରԠ༧ఆͱ͸͋Δ͕ɺ໨ॲ͸ཱͬͯͳͦ͞͏Ͱɺஆ͔͘Ԡԉ͠
    ·͠ΐ͏
    w Զʹ3VTUΛॻ͘ྗ͕͋Ε͹ɾɾɾʂʂ
    w ճආํ๏͸ʁˠઐ༻ͷΠϯσοΫεΛͦΕͧΕ࡞੒͢ΔʢͼΈΐ
    ͍ɾɾɾʣ

    View full-size slide

  17. ·ͱΊ
    w ৭ʑ՝୊͸͋ΕͲɺ.FJMJTFBSDI͸͍͍ͧ
    w αΫοͱ༻ҙͰ͖Δͧ
    w ೔ຊͰ͸ະͩ৘ใ΍ಋೖࣄྫগͳ͍ͷͰߩݙ͍ͯͧ͘͠
    w 3VTUΛֶͿͧ

    View full-size slide

  18. ͓·͚.FJMJTFBSDIΛ҆ఆͤ͞Δ
    w .FJMJTFBSDI$MPVE͸৑௕ԽͰ͖͍ͯΔΑ͏͕ͩɺࣗ෼ΒͰϗετ͢
    Δ৔߹͸؆୯ʹ͸Ͱ͖ͳ͍ʢఏڙ͞Ε͍ͯͳ͍ʣ
    w &MBTUJD4FBSDIΈͨ͘ɺ৑௕ߏ੒ΠϯσοΫεͷಉظͷΑ͏ͳػೳ
    ͕ఏڙ͞Ε͍ͯͳ͍
    w ͦͷͨΊɺࣗ෼ΒͰ҆ఆͳߏ੒Λ༻ҙ͢Δඞཁ͕͋Δ

    View full-size slide

  19. ͓·͚.FJMJTFBSDIΛ҆ఆͤ͞Δ
    w ো֐ϙΠϯτᶃσʔλͷόοΫΞοϓ
    w 4OBQTIPUͱEVNQ͕ఏڙ͞Ε͍ͯΔͷͰৄ͘͠͸υΩϡϝϯτΛಡΜͰ͍ͩ͘͞
    w ఆظతʹߋ৽͞ΕΔσʔλΛίϐʔͯ͠0CKFDUTUPSBHF΁ඈ͹͠ଓ͚͍ͯͨΒྑ͍ͱߟ͍͑ͯ·͢
    w ো֐ϙΠϯτᶄ৑௕ߏ੒
    w σʔλͷಉظΛͯ͘͠Εͳ͍ͨΊɺ৑௕Խ୆਺෼΁σʔλΛૹ৴͢Δ
    w ·ͨ͸ɺॻ͖ࠐΈɾಡΈࠐΈߏ੒ʹ෼͚ͯ৑௕ԽΛߦ͏
    w ো֐ϙΠϯτᶅσʔλͷϩετ
    w αʔό͕μ΢ϯ͍ͯ͠Δ৔߹ɺσʔλύΠϓϥΠϯ͔Βσʔλ͕౤͛ΒΕͳ͍ͷͰσʔλ͕ϩετͯ͠͠·
    ͏
    w μ΢ϯதͷظؒ෼ɺ࠶౓σʔλΛ౤͛ͳ͍ͱ͍͚ͳ͍ͷͰɺ෮چͷखॱ͕ͱͯ΋ΊΜͲ͍͘͞

    View full-size slide

  20. ͓·͚.FJMJTFBSDIΛ҆ఆͤ͞Δ

    View full-size slide