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

トルテが実践したマッチしたユーザーを除く3つの方法/torte-es

Take
September 11, 2017

 トルテが実践したマッチしたユーザーを除く3つの方法/torte-es

Take

September 11, 2017
Tweet

More Decks by Take

Other Decks in Technology

Transcript

  1. τϧς͕࣮ફͨ͠
    Ϛονͨ͠ϢʔβʔΛআͭ͘ͷํ๏
    த઒෢ݑ
    גࣜձࣾτϧςαʔόʔαΠυΤϯδχΞ
    $"JP

    View full-size slide

  2. IUUQTTXFFUUPSUFDPN
    ࡀҎ্ݶఆ

    View full-size slide

  3. ϨσΟʔϑΝʔετͷ࿀ΞϓϦ
    Torte

    View full-size slide

  4. ϨσΟʔϑΝʔετͷ࿀ΞϓϦ
    உੑ΁ͷΫνίϛͱ

    ϑΝʔετϝοηʔδ͸

    ঁੑͷಛݖ
    ࣗݾ঺հͰ͸ද͖͠Εͳ͍ɺ

    ࣸਅͱςΩετ͕ରʹͳͬͨ

    ΞϧόϜͰදݱ͞ΕΔݸੑ
    ঁੑͷಛݖ
    ΞϧόϜ

    View full-size slide

  5. த઒෢ݑ
    5",&/03*/","("8"
    גࣜձࣾτϧςαʔόʔαΠυΤϯδχΞ
    ೥౓ೖࣾ
    ࣗݾ঺հ
    IUUQTHJUIVCDPNXX

    View full-size slide

  6. Ϛονͨ͠ϢʔβʔΛআͭ͘ͷํ๏
    &MBTUJDTFBSDIPO&$
    "HFOEB
    w ϩδοΫ
    w ύϑΥʔϚϯε
    w Ϋϥ΢υൺֱ
    w ෛՙࢼݧ

    View full-size slide

  7. Ϛονͨ͠ϢʔβʔΛআ͘
    ͭͷํ๏

    View full-size slide

  8. w ύλʔϯ"
    w EPDVNFOUʹ࣋ͨͤΔ
    w ύλʔϯ#
    w RVFSZʹ࣋ͨͤΔ
    w ύλʔϯ$
    w 1BSFOUDIJMEΛ࢖͏
    Ϛονͨ͠ϢʔβʔΛআͭ͘ͷํ๏

    View full-size slide

  9. Ϛονͨ͠ϢʔβʔΛআͭ͘ͷํ๏
    6TFSEPDVNFOU
    JE
    OBNF ͋΍Ͷ
    HFOEFS GFNBMF
    CJSUIEBZ
    CJSUI@BSFB ౦ژ౎
    CMPPE@UZQF #
    IFJHIU

    View full-size slide

  10. Ϛονͨ͠ϢʔβʔΛআͭ͘ͷํ๏
    w طʹϚον͍ͯ͠Δ৔߹
    w ϒϩοΫ͍ͯ͠Δ৔߹
    w ඇදࣔʹ͍ͯ͠Δ৔߹
    ݕࡧ݁Ռʹग़ͯ͸͍͚ͳ͍
    6TFSEPDVNFOU
    JE
    OBNF ͋΍Ͷ
    HFOEFS GFNBMF
    CJSUIEBZ
    CJSUI@BSFB ౦ژ౎
    CMPPE@UZQF #
    IFJHIU

    View full-size slide

  11. Ϛονͨ͠ϢʔβʔΛআͭ͘ͷํ๏
    dύλʔϯ"d

    View full-size slide

  12. 6TFSEPDVNFOU
    JE
    OBNF ͋΍Ͷ
    HFOEFS GFNBMF
    CJSUIEBZ
    CJSUI@BSFB ౦ژ౎
    CMPPE@UZQF #
    IFJHIU
    FYDMVEF@VTFST ʜ
    6TFS*%
    dύλʔϯ"d
    FYDMVEFVTFSTʹࣗ෼ؚ͕·Ε
    ͍ͯͳ͍EPDVNFOUΛݕࡧ
    Ϛονͨ͠ϢʔβʔΛআͭ͘ͷํ๏

    View full-size slide

  13. 6TFSEPDVNFOU
    JE
    OBNF ͋΍Ͷ
    HFOEFS GFNBMF
    CJSUIEBZ
    CJSUI@BSFB ౦ژ౎
    CMPPE@UZQF #
    IFJHIU
    FYDMVEF@VTFST ʜ
    ϝϦοτ
    w γϯϓϧ
    w ݕࡧ͕଎͍
    σϝϦοτ
    w FYDMVEF@VTFSTͷංେԽ
    w ߋ৽͕஗͘ͳΔ
    dύλʔϯ"d
    Ϛονͨ͠ϢʔβʔΛআͭ͘ͷํ๏

    View full-size slide

  14. Ϛονͨ͠ϢʔβʔΛআͭ͘ͷํ๏
    "mappings" : {
    "user": {
    "properties": {
    "id": {
    "type": "keyword"
    },
    "name": {
    "type": "keyword",
    "index": false
    },
    /* தུ */
    "exclude_users": {
    "type": "keyword"
    }
    }
    }
    }

    View full-size slide

  15. Ϛονͨ͠ϢʔβʔΛআͭ͘ͷํ๏
    {
    "query": {
    "bool": {
    "must_not": {
    "term": {
    "exclude_users": "16"
    }
    }
    }
    }
    }

    View full-size slide

  16. Ϛονͨ͠ϢʔβʔΛআͭ͘ͷํ๏
    dύλʔϯ#d

    View full-size slide

  17. 6TFSEPDVNFOU
    JE
    OBNF ͋΍Ͷ
    HFOEFS GFNBMF
    CJSUIEBZ
    CJSUI@BSFB ౦ژ౎
    CMPPE@UZQF #
    IFJHIU
    ݕࡧΫΤϦͰ

    FYDMVEFVTFSTΛࢦఆ
    dύλʔϯ#d
    Ϛονͨ͠ϢʔβʔΛআͭ͘ͷํ๏

    View full-size slide

  18. 6TFSEPDVNFOU
    JE
    OBNF ͋΍Ͷ
    HFOEFS GFNBMF
    CJSUIEBZ
    CJSUI@BSFB ౦ژ౎
    CMPPE@UZQF #
    IFJHIU
    ϝϦοτ
    w γϯϓϧ
    w ߋ৽ॲཧ͕଎͍
    σϝϦοτ
    w ݕࡧΫΤϦͷංେԽ
    w ݕࡧ͕஗͘ͳΔ
    dύλʔϯ#d
    Ϛονͨ͠ϢʔβʔΛআͭ͘ͷํ๏

    View full-size slide

  19. Ϛονͨ͠ϢʔβʔΛআͭ͘ͷํ๏
    {
    "query": {
    "bool": {
    "must_not": {
    "terms": {
    "id": ["1", "6", "9", "13"]
    }
    }
    }
    }
    }

    View full-size slide

  20. Ϛονͨ͠ϢʔβʔΛআͭ͘ͷํ๏
    dύλʔϯ$d

    View full-size slide

  21. 6TFSEPDVNFOU
    JE
    OBNF ͋΍Ͷ
    HFOEFS GFNBMF
    CJSUIEBZ
    CJSUI@BSFB ౦ژ౎
    CMPPE@UZQF #
    IFJHIU
    dύλʔϯ$d
    FYDMVEFVTFS
    EPDVNFOU
    JE
    SFBTPO ϚονࡁΈ
    ݕࡧΫΤϦͰFYDMVEFVTFS

    ࣗ෼
    Λࢠʹ࣋ͨͳ͍

    EPDVNFOUΛݕࡧ
    6TFS*%
    Ϛονͨ͠ϢʔβʔΛআͭ͘ͷํ๏

    View full-size slide

  22. 6TFSEPDVNFOU
    JE
    OBNF ͋΍Ͷ
    HFOEFS GFNBMF
    CJSUIEBZ
    CJSUI@BSFB ౦ژ౎
    CMPPE@UZQF #
    IFJHIU
    FYDMVEFVTFS
    EPDVNFOU
    JE
    SFBTPO ϚονࡁΈ
    ϝϦοτ
    w ൺֱతݕࡧ΋ߋ৽΋଎͍
    σϝϦοτ
    w ෳࡶ
    w FYDMVEFVTFSͷ෼

    EPDVNFOU਺͕૿Ճ
    w 1BSFOUDIJME͸&4ܥͰ

    ࢓༷มߋ͕༧ఆ͞Ε͍ͯΔ
    Ϛονͨ͠ϢʔβʔΛআͭ͘ͷํ๏
    dύλʔϯ$d

    View full-size slide

  23. 6TFSEPDVNFOU
    JE
    OBNF ͋΍Ͷ
    HFOEFS GFNBMF
    CJSUIEBZ
    CJSUI@BSFB ౦ژ౎
    CMPPE@UZQF #
    IFJHIU
    FYDMVEFVTFS
    EPDVNFOU
    JE
    SFBTPO ϚονࡁΈ
    ϝϦοτ
    w ൺֱతݕࡧ΋ߋ৽΋଎͍
    σϝϦοτ
    w ෳࡶ
    w FYDMVEFVTFSͷ෼

    EPDVNFOU਺͕૿Ճ
    w 1BSFOUDIJME͸&4ܥͰ

    ࢓༷มߋ͕༧ఆ͞Ε͍ͯΔ
    Ϛονͨ͠ϢʔβʔΛআͭ͘ͷํ๏
    dύλʔϯ$d
    5PSUFͰ࠾༻

    View full-size slide

  24. Ϛονͨ͠ϢʔβʔΛআͭ͘ͷํ๏
    "mappings" : {
    "user": {
    "properties": {
    "id": {
    "type": "keyword"
    },
    /* தུ */
    }
    },
    "exclude_user": {
    "_parent": {
    "type": "user"
    },
    "properties": {
    "id": {
    "type": "keyword"
    },
    "reason": {
    "type": "short"
    }
    }
    }
    }

    View full-size slide

  25. Ϛονͨ͠ϢʔβʔΛআͭ͘ͷํ๏
    {
    "query": {
    "bool": {
    "must_not": {
    "has_child": {
    "type": "exclude_user",
    "query": {
    "term": {
    "id": "16"
    }
    }
    }
    }
    }
    }
    }

    View full-size slide

  26. 6TFSEPDVNFOU
    JE
    OBNF ͋΍Ͷ
    HFOEFS GFNBMF
    CJSUIEBZ
    CJSUI@BSFB ౦ژ౎
    CMPPE@UZQF #
    IFJHIU
    FYDMVEFVTFS
    EPDVNFOU
    JE
    SFBTPO ϚονࡁΈ
    ϝϦοτ
    w ൺֱతݕࡧ΋ߋ৽΋଎͍
    σϝϦοτ
    w ෳࡶ
    w FYDMVEFVTFSͷ෼

    EPDVNFOU਺͕૿Ճ
    w 1BSFOUDIJME͸&4ܥͰ

    ࢓༷มߋ͕༧ఆ͞Ε͍ͯΔ
    Ϛονͨ͠ϢʔβʔΛআͭ͘ͷํ๏
    dύλʔϯ$d
    5PSUFͰ࠾༻
    %&13&$"5&%

    View full-size slide

  27. KPJOEBUBUZQF
    Ϛονͨ͠ϢʔβʔΛআͭ͘ͷํ๏
    IUUQTXXXFMBTUJDDPHVJEFFOFMBTUJDTFBSDISFGFSFODFYQBSFOUKPJOIUNM

    View full-size slide

  28. &MBTUJDTFBSDIPO&$

    View full-size slide

  29. w &MBTUJD$MPVE
    w "NB[PO&MBTUJDTFBSDI4FSWJDF
    &MBTUJDTFBSDIPO&$ൺֱ

    View full-size slide

  30. &MBTUJD$MPVE
    w &MBTUJDࣾެࣜͷϑϧϚωʔδυαʔϏε
    w ೝূ
    w )5514઀ଓͷ#BTJDೝূͰ࣮૷͕؆୯
    w ,JCBOBͷ6*͔ΒϢʔβʔ௥Ճ
    w ࡉ͔͍3PMFͷ؅ཧ͕Մೳ
    w ࠷৽ͷ&MBTUJDTFBSDI͕ར༻Մೳ
    &MBTUJDTFBSDIPO&$&MBTUJD$MPVE

    View full-size slide

  31. &MBTUJD$MPVE
    w μ΢ϯλΠϜͳ͠Ͱखಈεέʔϧ
    w &MBTUJDTFBSDIͷϩάΛ؅ཧը໘͔Β֬ೝ
    Ͱ͖Δ
    w ࣗಈͰTOBQTIPUΛ4ʹ౤͛ΒΕΔ
    w "84ͱ($1ͷ্Ͱར༻Մೳ
    w ϢʔβʔࣙॻͱεΫϦϓτʹରԠ
    &MBTUJDTFBSDIPO&$&MBTUJD$MPVE

    View full-size slide

  32. "NB[PO&MBTUJDTFBSDI4FSWJDF
    w "84ͷϑϧϚωʔδυαʔϏε
    w ೝূ
    w *".͕ར༻Մೳ
    w &MBTUJDTFBSDI͕ར༻Մೳ d

    &MBTUJDTFBSDIPO&$"NB[PO&MBTUJDTFBSDI4FSWJDF

    View full-size slide

  33. "NB[PO&MBTUJDTFBSDI4FSWJDF
    w ࣗಈTOBQTIPU͕ར༻Մೳ 4

    w ΠϯελϯεͷλΠϓ΍Ϋϥελͷߏ੒Λ
    ࡉ͔͘ઃఆՄೳ
    w ,JOFTJT'JSFIPTF 

    -BNCEB 

    $MPVE8BUDIͱͷ਌࿨ੑͷߴ͞
    &MBTUJDTFBSDIPO&$"NB[PO&MBTUJDTFBSDI4FSWJDF

    View full-size slide

  34. w &MBTUJD$MPVE
    w 91BDL΋࢖͑ͯશ෦ೖΓ
    w ࠷৽ͷ&MBTUJDTFBSDI͕࢖͑Δ
    w ($1΋બ΂Δ
    w "NB[PO&MBTUJDTFBSDI4FSWJDF
    w ϩάूܭͱՄࢹԽ͕໨తͷ৭͕ڧ͍
    w طଘͷϚωδϝϯταʔϏεͱͷ౷߹͕ڧྗ
    w ݕࡧͱͯ͠͸$MPVE4FBSDI΋͋Δ
    &MBTUJDTFBSDIPO&$ൺֱ

    View full-size slide

  35. ෛՙࢼݧ
    w ϦϦʔε೥ޙ΍ɺλοϓϧ஀ੜن໛ʹ੒௕
    ͨ͠৔߹ͷෛՙΛ૝ఆ
    w (BUMJOH

    IUUQHBUMJOHJP
    &MBTUJDTFBSDIPO&$

    View full-size slide

  36. ෛՙࢼݧ
    &MBTUJDTFBSDIPO&$
    ෛՙʹ଱͑ͨ࣌ ෛՙʹ଱͑ΒΕͳ͔ͬͨ࣌

    View full-size slide

  37. ෛՙࢼݧ
    &MBTUJDTFBSDIPO&$
    ෛՙʹ଱͑ͨ࣌ ෛՙʹ଱͑ΒΕͳ͔ͬͨ࣌

    View full-size slide

  38. &MBTUJDTFBSDIPO&$
    w ߏஙӡ༻Ͱ͖ΔΤϯδχΞ͕ډΕ͹

    ίετύϑΥʔϚϯε࠷ڧ
    w BOTJCMFͰ؅ཧͯ͠ɺԣ࣠૊৫Ͱڞ༗
    &MBTUJDTFBSDIPO&$
    ٕज़ຊ෦43(͋Γ͕ͱ͏
    IUUQTEFWFMPQFSTDZCFSBHFOUDPKQCMPHBSDIJWFT

    View full-size slide

  39. ߏ੒
    w NBTUFSOPEFY
    w EBUBOPEFY
    &MBTUJDTFBSDIPO&$

    View full-size slide

  40. ઃఆ FMBTUJDTFBSDIZNM

    w TXBQ QBHJOH
    ʹΑΔੑೳྼԽΛ๷͙
    w JOEFYͷࣗಈ࡞੒ʹΑΔҙਤ͠ͳ͍ڍಈΛ๷͙
    &MBTUJDTFBSDIPO&$
    bootstrap.memory_lock: true
    action.auto_create_index: "+*,-data-*"

    View full-size slide

  41. JOEFYઃܭ NBQQJOH

    w @TPVSDF͸6QEBUF"1*ͷͨΊʹ༗ޮԽ
    w @BMM͸ແޮԽ
    &MBTUJDTFBSDIPO&$
    "_source": {"enabled": true}
    "_all": {"enabled": false}

    View full-size slide

  42. JOEFYઃܭ NBQQJOH

    w EZOBNJD͸ແޮʹ BVUP@DSFBUF@JOEFYͱಉ͡ཧ༝

    w ݕࡧର৅ʹͳΒͳ͍pFME͸JOEFY͠ͳ͍
    &MBTUJDTFBSDIPO&$
    "dynamic": false
    "name": {
    "type": "keyword",
    "index": false
    }

    View full-size slide

  43. զʑ͸&MBTUJDTFBSDIʹ

    ޲͖߹͍͔ͬͯͳ͚Ε͹ͳΒͳ͍
    ·ͱΊ

    View full-size slide

  44. w 1BSFOU$IJME3FMBUJPOTIJQ

    IUUQTXXXFMBTUJDDPHVJEFFOFMBTUJDTFBSDI
    HVJEFDVSSFOUQBSFOUDIJMEIUNM
    w KPJOEBUBUZQF

    IUUQTXXXFMBTUJDDPHVJEFFOFMBTUJDTFBSDI
    SFGFSFODFYQBSFOUKPJOIUNM
    w %JTBCMFTXBQQJOH

    IUUQTXXXFMBTUJDDPHVJEFFOFMBTUJDTFBSDI
    SFGFSFODFDVSSFOUTFUVQDPOpHVSBUJPO
    NFNPSZIUNM
    ·ͱΊࢀߟจݙ

    View full-size slide