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

Slackの全文検索 サービスを作った話 / slack-search

odanado
February 24, 2018

Slackの全文検索 サービスを作った話 / slack-search

odanado

February 24, 2018
Tweet

More Decks by odanado

Other Decks in Programming

Transcript

  1. Slackͷશจݕࡧ
    αʔϏεΛ࡞ͬͨ࿩

    View full-size slide

  2. Slackͷ՝୊
    • ϑϦʔϓϥϯͷSlackʹ͸৭ʑ੍ݶ͕͋Δ
    • App(bot) ͸10ݸ·Ͱ
    • ετϨʔδ༰ྔͷ੍ݶ
    • ௚ۙ1ສ݅ΑΓݹ͍ϝοηʔδ͸ࢀরෆՄೳ
    • ͜ΕΒͷ੍ݶ͸େֶͷ෦׆Ͱ໰୊ʹͳ͍ͬͯͨ
    • ༗ྉϓϥϯ͸ΞΫςΟϒϢʔβ1ਓʹ͖ͭຖ݄
    1000ԁ
    • ֶੜϓϥϯΛద༻ͯ͠΋ׂߴ
    • SlackͷϩάΛશจݕࡧ͢ΔαʔϏε
    • Slackͷϩά͸adminͳΒzipͰμ΢ϯϩʔυՄೳ

    View full-size slide

  3. γεςϜͷ֓ཁ
    શจݕࡧ
    όοΫΤϯυ
    Ϣʔβͷtoken؅ཧ
    ϑϩϯτΤϯυ
    OAuthೝূ

    View full-size slide

  4. ϑϩϯτΤϯυ
    • nuxt.js
    • φΫετ ͱಡΉ
    • vue.jsΛ༻͍ͨwebΞϓϦΛ
    ։ൃ͢ΔͨΊͷϑϨʔϜϫʔΫ
    • ΠέΠέ
    • vue.js
    • Ծ૝DOMΛ༻͍ͨߴ଎ͳHTMLੜ੒
    • ίϯϙʔωϯτࢦ޲
    • element-ui
    • vue.js੡ͷίϯϙʔωϯτϥΠϒϥϦ

    View full-size slide

  5. όοΫΤϯυ
    • Flask
    • Python੡ͷwebϑϨʔϜϫʔΫ
    • DjangoΑΓѻ͍΍͍͢ϑϨʔϜϫʔΫ
    • ࣮ࡍ؆୯

    View full-size slide

  6. ϛυϧ΢ΣΞ
    • ElasticSearch
    • Java੡ͷશจݕࡧΤϯδϯ
    • ܗଶૉղੳ kuromoji
    • ࣙॻ neologd
    • ώʔϓαΠζ 512MB
    • ະࢦఆͰىಈͨ͠ΒMac͕ϑϦʔζ͔͚ͨ͠…
    • PostgreSQL
    • ϊϦͰબΜͩ
    • Python͔ΒSQLalchemyͱ͍ϥΠϒϥϦͰୟ͍ͨ

    View full-size slide

  7. Πϯϑϥ
    • Docker
    • ίϯςφܕԾ૝Խ
    • docker-compose
    • ෳ਺ͷίϯςφΛ·ͱΊͯѻ͑Δ΍ͭ
    • docker-compose up Λ࣮ߦ͢Ε͹
    αʔϏε͕ಈ͘

    View full-size slide

  8. γεςϜͷ֓ཁ Ϣʔβೝূ
    OAuthϦΫΤετ
    ίʔϧόοΫ
    tokenൃߦ
    (Json Web Token)

    View full-size slide

  9. γεςϜͷ֓ཁ ݕࡧ
    token+ݕࡧϫʔυ
    ݕࡧΫΤϦ
    લ΋ͬͯzip͔Β
    σʔλΛ
    ΠϯϙʔτࡁΈ
    Ϣʔβͷ֬ೝ

    View full-size slide

  10. ࠓޙͷ՝୊
    • ແݶϦϩʔυͷ࣮૷
    • element-uiʹόά͕͋Γ࣮૷ͷݟ௨͠ͳ͠
    • ElasticSearchͷνϡʔχϯά
    • ݱঢ়ετοϓϫʔυʹ΋Ϛον͢Δ
    • ෦һޠ࿥Λkuromojiͷࣙॻʹొ࿥
    • Sudachi͕͍͍ͱฉ͘ͷͰࢼ͍ͨ͠
    • ը૾ͷදࣔ
    • ϝοηʔδதʹը૾URL͕͋Ε͹ͦΕΛදࣔ
    • ֆจࣈͷදࣔ
    • Slack RTM API͔ΒݕࡧIndexߏங
    • όοΫΤϯυΛrailsͰॻ͖͍ͨ

    View full-size slide