Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
宿泊予約サイトにおける検索と料金計算の両立
Search
Shoichi Kaji
September 18, 2024
Programming
2
2.5k
宿泊予約サイトにおける検索と料金計算の両立
一休×AEON 事業会社のサービスを支える基盤開発トーク 2024/09/18
https://ikyu.connpass.com/event/327095/
Shoichi Kaji
September 18, 2024
Tweet
Share
More Decks by Shoichi Kaji
See All by Shoichi Kaji
昔のGo, 今のGo ~比較, ソート編~
skaji
0
170
Perl Quiz
skaji
0
130
cpm at PerlCon 2019
skaji
0
110
Perl5 Package Manager
skaji
0
660
Internal of cpm
skaji
0
570
How to execute external programs in Perl
skaji
3
570
Writing Perl with w0rp/ale
skaji
0
2.2k
nginx unit
skaji
0
44
Perl6 ecosystem
skaji
1
1.4k
Other Decks in Programming
See All in Programming
Figma Dev Modeで変わる!Flutterの開発体験
watanave
0
140
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
960
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
1
300
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
3
690
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
340
色々なIaCツールを実際に触って比較してみる
iriikeita
0
330
Jakarta EE meets AI
ivargrimstad
0
660
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
250
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
200
CSC509 Lecture 11
javiergs
PRO
0
180
Realtime API 入門
riofujimon
0
150
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
890
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
GraphQLとの向き合い方2022年版
quramy
43
13k
The Pragmatic Product Professional
lauravandoore
31
6.3k
Bash Introduction
62gerente
608
210k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Building Applications with DynamoDB
mza
90
6.1k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
Music & Morning Musume
bryan
46
6.2k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
Transcript
॓ധ༧αΠτʹ͓͚Δ ݕࡧͱྉۚܭࢉͷཱ྆ Shoichi Kaji
॓ധ༧αΠτ Ұٳ.com
͢͜ͱ • ॓ധ༧αΠτҰٳ.comͰͨ͘͞ΜͷॴͰ "ྉۚ"Λܭࢉ͠ද͍ࣔͯ͠Δ • ݕࡧͱྉۚܭࢉີʹؔ࿈͍ͯ͠Δ • Solr + Solr
pluginͰݕࡧͱྉۚܭࢉΛཱ྆ͤ͞ ͍ͯΔ
Ұٳ.comʹ͓͚Δྉۚͷදࣔ ͨ͘͞ΜͷॴͰ"ྉۚ"Λ ද͍ࣔͯ͠Δ "ྉۚ"Ϣʔβ͕ϗςϧΛ બͿ্Ͱॏཁͳࢦඪͷͻͱͭ
"ྉۚ"ʹٻΊΒΕΔͷ • ֤छ݅ɺ֤छׂҾΛՃຯ্ͨ͠Ͱͷྉۚ -> ࣄલʹͯ͢ͷ߹ΛٻΊ͓ͯ͘ͷࠔɺ ΦϯϥΠϯͰܭࢉ͢Δඞཁ͕͋Δ • ࢠڙྉۚ • ׂҾͷ݅:
ରձһϥϯΫɺ༗ޮظݶɺର॓ധɺഉଞ੍ޚ • ຊདྷྉۚ༧ʹରܾͯ͠·Δͷ • τοϓϖʔδʹ֤ϗςϧʹྉ͕ۚදࣔ͞Ε͍ͯΔɻ͜Ε͜ͷϗςϧ͕औΓ͏Δྉۚ ͷதͰͷ࠷খΛද͍ࣔͯ͠Δ (collapse)ɻΑͬͯཪͰԿेഒͷྔͷྉۚܭࢉΛ͠ ͳ͍ͱ͍͚ͳ͍ • ݕࡧϖʔδʹදࣔ͞Ε͍ͯΔྉۚɺ֤छ fi lterΛөͨ͠ͷ • ͨͱ͑ʮே৯͖ʯͱ͍͏ fi lter͕՝͞ΕΕɺே৯͖ϓϥϯͷྉۚͷ࠷҆
ݕࡧͱྉۚܭࢉີʹؔ࿈ • લड़ͷ௨ΓɺྉۚܭࢉͷதͰcollapse, fi lterͳͲ "ݕࡧ"จ຺Ͱग़ͯ͘Δͷͱಉ͡ॲཧΛඞཁͱ͢Δ • ܭࢉ͞ΕͨྉۚΛʮ2ສԁҎԼͷϗςϧʹߜΔʯ ʮྉۚͷ͍҆ॱʹฒΔʯͳͲݕࡧͷ fi
lter, sort ʹ͏͜ͱ͋Δ • ݕࡧͱྉۚܭࢉಉ࣌ʹѻ͑ͳ͍ͱ͍͚ͳ͍
ີʹؔ࿈͠߹ͬͨݕࡧɺ ྉۚܭࢉΛͲ͏࣮ݱ͢Δ͔ʁ
ݕࡧ • ·ͣݕࡧ • ҰൠʹݕࡧΤϯδϯͱͯ͠Elasticsearch, Apache SolrͳͲ͕ީิͱ͕ͯ͋͠Δ • Ұٳ.comͰApache SolrΛ࠾༻͍ͯ͠Δ
ݕࡧ Solr • Apache Solr • "ݕࡧ"ͱݴͬͯࢥ͍ු͔Ϳػೳ͍͍ͩͨἧ͓ͬͯΓɺ ͱͯΑ͍ιϑτΣΞͩͱࢥ͏ https://solr.apache.org/
ྉۚܭࢉ • ࣍ʹྉۚܭࢉɻલड़ͷ௨Γɺྉۚܭࢉݕࡧͱಉ࣌ʹͰ͖Δ ͷ͕·͍͠ɻSolrͰྉۚܭࢉͰ͖Δʁ • SolrͰquery্ͰࣜΛఆٛ͠ɺͦͷ݁ՌΛฦ͢͜ͱͰ͖Δ • ྉۚܭࢉSolr query্ͰࣜΛఆٛ͢Ε͍͍ͷͰʁ //
query.json { "query": "*:*", "fields": [ "product(sum(Price1_i,Price2_i),div(sub(100,Rate_f),100))" ] } // response { "response":{"docs":[{ "product(sum(Price1_i,Price2_i)...)":50487.36 }]} }
ྉۚܭࢉ • ྉۚܭࢉSolr query্ͰࣜΛఆٛ͢Ε͍͍ͷͰʁ • ͑: ݫ͍͠ 🥲 • ෳࡶͳܭࢉΛSolr
query্Ͱදݱ͢Δͷ͔ͳΓݫ͠ ͍ɻͱ͘ʹҰ࣌มΛѻ͍ʹ͍͘ • ܭࢉ͕ෳࡶͩͱͦͷSolr queryͷαΠζ૿͑Δɻ ͦͯ͠parseͷίετ͔ͳΓ͔͔Δ
ྉۚܭࢉ Solr plugin • ͰͲ͏͢Δ͔ʁ • Solrʹpluginػߏ͕͋Δ • JavaͰϓϩάϥϜΛॻ͖ɺSolrͷ֤छॲཧΛ ΧελϚΠζͰ͖Δ
• ಛʹSolr query্Ͱ͑ΔಠࣗؔΛఆٛͰ͖Δ
ྉۚܭࢉ Solr plugin • Solr query্ͰྉۚΛܭࢉͯ͠ฦ͢ my_priceؔΛಋೖ͠ɺͦͷ࣮Λ MyPriceParser.javaͱͯ͠ॻ͚Α͍ // my_priceͷ࣮:
MyPriceParser.java public class MyPriceParser extends ValueSourceParser { @Override public ValueSource parse(FunctionQParser fp) throws SyntaxError { ... } } // query.json { "query": "*:*", "fields": [ "my_price(20240901,2,3)" ] }
ྉۚܭࢉ Solr plugin • Solr pluginʹΑΔಠ࣮ࣗؔଟ͘ͷར͕͋Δ • JavaͰهड़Ͱ͖ΔͷͰɺมɺΫϥεͳͲͳΜͰ͑Δ • indexσʔλͷಡΈऔΓJavaͰهड़Ͱ͖ΔͷͰɺಠࣗʹγϦΞϥΠζͨ͠
σʔλͳͲΛindex͠͏͜ͱͰ͖Δ • σʔλιʔεͱͯ͠indexσʔλҎ֎ͷͷ͑Δ • ͦͯͪ͠ΖΜmy_priceΛ fi lter,sortͯ͑͠Δʂ • { "query": "*:*", "filter": ["{!frange u=20000}my_price(20240901,2,3)"], // 2ສԁҎԼ "sort": "my_price(20240901,2,3) asc", // ྉۚͷ͍҆ॱ "fields": ["my_price(20240901,2,3)"] }
Solr + Solr pluginΛͬͯ ݕࡧɺྉۚܭࢉΛཱ྆Ͱ͖ͨ 😉
·ͱΊ • ॓ധ༧αΠτҰٳ.comͰͨ͘͞ΜͷॴͰ "ྉۚ"Λܭࢉ͠ද͍ࣔͯ͠Δ • ݕࡧͱྉۚܭࢉີʹؔ࿈͍ͯ͠Δ • Solr + Solr
pluginͰݕࡧͱྉۚܭࢉΛཱ྆ͤ͞ ͍ͯΔ