Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Let_s_Go_Talk__6__GoのLT会_.pdf
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
虎の穴ラボ株式会社
January 19, 2023
Technology
160
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Let_s_Go_Talk__6__GoのLT会_.pdf
Let's Go Talk #6 (GoのLT会)の発表資料になります。
https://connehito.connpass.com/event/270615/
虎の穴ラボ株式会社
January 19, 2023
More Decks by 虎の穴ラボ株式会社
See All by 虎の穴ラボ株式会社
関西Ruby登壇資料
toranoana
0
33
Tailwind CSSとAtomic Designで実現する効率的な Web 開発の事例
toranoana
1
710
Denoについて、同人誌記事を出しました+update
toranoana
0
240
【虎の穴ラボ Tech Talk #2】プロンプトエンジニアリング
toranoana
0
170
20241121_[TechTalk#2]虎の穴ラボでのLLMについて取り組み紹介
toranoana
0
180
社内チャットへRAG導入した話(Tech Talk #2)
toranoana
0
250
Deno Deploy で Web Cache API を 使えるようになったので試した知見
toranoana
1
760
【虎の穴ラボ Tech Talk】虎の穴ラボTech Talk説明資料
toranoana
0
530
虎の穴ラボ Tech Talk_CDKでFargate環境構築
toranoana
1
700
Other Decks in Technology
See All in Technology
AIに任せた品質は、誰が見立てるのか - AI時代のテストマネジメント
nakanao
3
2.9k
AIに賢く動いてもらうためのコンテキスト〜Snowflake女子会 vol.8
snowwmn0824
0
160
aws-iot-platform-architecture-use-cases.pdf
ma2shita
0
530
リアーキテクチャ後の障害ゼロを目指したShadow Testingの取り組み
nihonbuson
PRO
1
170
Genieを崇めよ
kameitomohiro
0
170
時うどん〜Socket.getifaddrsで学ぶネットワーク編 / Tokiudon: The Socket.getifaddrs Edition
coe401_
4
220
AI coding 整合正規方法
philipz
0
500
AI 時代のスタートアップエコシステ厶から考究する技術的負債との向き合い方
m3m0r7
PRO
3
2.6k
Slack上でインフラをトラブルシュートする! Agentic Platform Engineeringの第一歩
teru0x1
5
1.9k
「ピッケル本」日本語版は4.0(第6版)が出版されるべき / pickaxe4-nagoyark05
kakutani
2
280
AIによるクリエイティブ生成を行う上での試行錯誤
plaidtech
PRO
0
180
AIを活用するために決めた "やらないこと" - 価値に注目する / Not betting on AI
soudai
PRO
3
590
Featured
See All Featured
Faster Mobile Websites
deanohume
310
32k
The browser strikes back
jonoalderson
0
1.7k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
42k
GitHub's CSS Performance
jonrohan
1033
470k
Building a Scalable Design System with Sketch
lauravandoore
464
34k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
280
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
850
Google's AI Overviews - The New Search
badams
0
1.6k
Speed Design
sergeychernyshev
33
2.1k
Technical Leadership for Architectural Decision Making
baasie
3
580
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
770
Transcript
Copyright (C) 2020 Toranoana Inc. All Rights Reserved. GoからOpenSearchServiceを 使ってみる
虎の穴ラボ株式会社 浜田拓実 (sheltie) 2023 Let's Go Talk #6 (GoのLT会)
Copyright (C) 2020 Toranoana Inc. All Rights Reserved. 自己紹介 浜田
拓実(ハマダ タクミ) • 2022/06 入社 • 虎の穴ラボ 通販チーム エンジニア Goを始めたきっかけ • 社内勉強会でGoが取り上げられた • 昨年末よりGoでWebアプリを作り始める
Copyright (C) 2020 Toranoana Inc. All Rights Reserved. アジェンダ •
作成物の概要 • OpenSearchについて • ドキュメントの登録 • ドキュメントの検索 • 注意点 • まとめ
Copyright (C) 2020 Toranoana Inc. All Rights Reserved. 作成物の概要 ・楽天APIから商品情報を日次で取得
・取得データをOpenSearchに登録 ・キーワードでOpenSearchを検索 GoとOpenSearchの練習のため作成
Copyright (C) 2020 Toranoana Inc. All Rights Reserved. OpenSearchについて
Copyright (C) 2020 Toranoana Inc. All Rights Reserved. OpenSearchについて OpenSearchとは・・・
• ElasticSearchをフォークして 開発が行われている • データ検索、分析、可視化が可能。 • 100%オープンソース
Copyright (C) 2020 Toranoana Inc. All Rights Reserved. OpenSearchについて Goから利用する
• 公式から環境構築のDockerサンプルが 提供されている • Go クライアントが提供されている
Copyright (C) 2020 Toranoana Inc. All Rights Reserved. OpenSearchについて Dockerサンプル
Copyright (C) 2020 Toranoana Inc. All Rights Reserved. Goから利用する (ドキュメントの登録)
Copyright (C) 2020 Toranoana Inc. All Rights Reserved. ドキュメントの登録 公式サンプルを利用する
• Goクライアントを利用した実装例 • CRUD操作を一通り実施
Copyright (C) 2020 Toranoana Inc. All Rights Reserved. ドキュメントの登録 APIはJSON形式でやりとり
• APIのパラメータに適した 構造体の定義 • json.Marshal / Unmarshalを利用 • JSON-to-GoでJSONを構造体に変換 https://mholt.github.io/json-to-go/
Copyright (C) 2020 Toranoana Inc. All Rights Reserved. ドキュメントの登録 実際の実装内容
Copyright (C) 2020 Toranoana Inc. All Rights Reserved. Goから利用する (ドキュメントの検索)
Copyright (C) 2020 Toranoana Inc. All Rights Reserved. ドキュメントの検索 公式サンプルを利用する
• こちらもJSON形式でやりとり • 独特な検索クエリに慣れる必要あり
Copyright (C) 2020 Toranoana Inc. All Rights Reserved. ドキュメントの検索 実際の実装内容(前半)
Copyright (C) 2020 Toranoana Inc. All Rights Reserved. ドキュメントの検索 実際の実装内容(後半)
Copyright (C) 2020 Toranoana Inc. All Rights Reserved. 注意点
Copyright (C) 2020 Toranoana Inc. All Rights Reserved. 注意点 大量のドキュメントをループで登録中、以下のようなエラーが発生
Copyright (C) 2020 Toranoana Inc. All Rights Reserved. 注意点 公式サンプルとの相違点
• 更新サンプルはレスポンスを 閉じる処理が省略されている • Go Packagesのサンプルでは レスポンスを閉じる処理有り レスポンスを閉じないと、 先ほどのエラーが発生するため注意
Copyright (C) 2020 Toranoana Inc. All Rights Reserved. まとめ
Copyright (C) 2020 Toranoana Inc. All Rights Reserved. まとめ GoからOpenSearchを取り扱うのは比較的簡単
・OpenSearch、Go共にサンプルが充実 ・Goクライアントが用意されている ・GoとJSONの相性が良い(気がする) OpenSearchはGoと相性の良い 検索エンジンだと感じました