Recommended
PDF
2013OSC関西@京都_CloudStackとCloudFoundaryがまるわかり!
PPTX
KEY
PDF
“bcache”を使ってSSDの速さと HDDの大容量のいいとこどり 2015-12-12
PPTX
PDF
Ubuntuとコンテナ技術 What is LXD? and Why? 2015-12-08
PDF
RancherでMesosクラスタをデプロイしてみる的ななにか
PDF
PPTX
PDF
hs_spider_hs_something_20110906
PDF
Log analysis by using elasticsearch,kibana and fluentd.
PPTX
PDF
Rancher Meetup Tokyo #4 Intro
PDF
PDF
PDF
丸の内MongoDB勉強会#20LT 2.8のストレージエンジン動かしてみました
PDF
PDF
Chef Howto with Vagrant + Berkshelf
PDF
Apache CloudStack 4.0 インストール(ver0.5)
PDF
「おれのクラウド」今日から始めるオブジェクトストレージ
PDF
PPT
PPTX
PDF
データ加工ストリーミングのすすめ2012 11 20
PPTX
PDF
PDF
XenServerとZFSストレージでサーバ仮想化 - OSC2011 Tokyo/Spring 自宅SAN友の会(後半)
PDF
PDF
ElasticSearch+Kibanaでログデータの検索と視覚化を実現するテクニックと運用ノウハウ
PDF
Elastic Stackの紹介とOpenStackでの活用事例(Searchlightなど) - OpenStack最新情報セミナー 2016年5月
More Related Content
PDF
2013OSC関西@京都_CloudStackとCloudFoundaryがまるわかり!
PPTX
KEY
PDF
“bcache”を使ってSSDの速さと HDDの大容量のいいとこどり 2015-12-12
PPTX
PDF
Ubuntuとコンテナ技術 What is LXD? and Why? 2015-12-08
PDF
RancherでMesosクラスタをデプロイしてみる的ななにか
PDF
What's hot
PPTX
PDF
hs_spider_hs_something_20110906
PDF
Log analysis by using elasticsearch,kibana and fluentd.
PPTX
PDF
Rancher Meetup Tokyo #4 Intro
PDF
PDF
PDF
丸の内MongoDB勉強会#20LT 2.8のストレージエンジン動かしてみました
PDF
PDF
Chef Howto with Vagrant + Berkshelf
PDF
Apache CloudStack 4.0 インストール(ver0.5)
PDF
「おれのクラウド」今日から始めるオブジェクトストレージ
PDF
PPT
PPTX
PDF
データ加工ストリーミングのすすめ2012 11 20
PPTX
PDF
PDF
XenServerとZFSストレージでサーバ仮想化 - OSC2011 Tokyo/Spring 自宅SAN友の会(後半)
PDF
Similar to Elastic searchをrailsから使ってみた
PDF
ElasticSearch+Kibanaでログデータの検索と視覚化を実現するテクニックと運用ノウハウ
PDF
Elastic Stackの紹介とOpenStackでの活用事例(Searchlightなど) - OpenStack最新情報セミナー 2016年5月
PDF
MySQLと組み合わせて始める全文検索プロダクト"elasticsearch"
PDF
What's New in the Elastic 8.4 Release
PDF
Elasticsearch入門 pyfes 201207
PDF
Elastic circle ci-co-webinar-20210127
PDF
Elasticsearch at CrowdWorks
PDF
JJUG CCC リクルートの Java に対する取り組み
PDF
Renewed using elasticsearchonaspnet-core5
PDF
PPTX
Elasticsearch 5.2とJava Clientで戯れる #elasticsearchjp
PDF
PDF
PDF
Amazon Elasticsearch Service & Open Distro for Elasticsearch Meetup
PDF
PDF
Integrating elasticsearch with asp dot net core
PDF
実践!Elasticsearch + Sudachi を用いた全文検索エンジン
PDF
aws blackbelt amazon elasticsearch service
PPTX
PDF
Introducing the elastic 8.0 release a new era of speed, scale, relevance, and...
More from Yoichi Toyota
PDF
PDF
PDF
PDF
PDF
PDF
PDF
PDF
PDF
PDF
PDF
PDF
PDF
PPTX
ActionCableのクライアントはRails外から利用できるのか
PPTX
PDF
PDF
PDF
PDF
How to fight against “full scratch disease”
PDF
Elastic searchをrailsから使ってみた 1. 2. 3. 4. 公式でrpm, debパッケージを配布
◦ http://www.elasticsearch.org/download/
◦ 例) Ubuntuでのセットアップ
$ apt-get install openjdk-7-jdk
$ dpkg -i elasticsearch-0.90.1.deb
5. HTTPで実行可能
◦ curlコマンドで一通りの操作が可能
◦ インデックス作成
$ curl –XPUT ‘localhost:9200/twitter’
◦ データの追加
$ curl –XPUT ‘localhost:9200/twitter/tweet’ –d ‘{
“user”: “rs_wisteria”,
“message”:”中二病、高二病と変遷し、加齢とともにたどり
着く先が成人病であるならば俺は一生中二病でいい。”
}’
6. JSONで記述可能なDSLを利用する
◦ 例) userがrs_wisteriaなデータを検索するクエリ
$ curl –XGET ‘localhost:9200/twitter/_search’ –d ‘{
“query” : {
“query_string” : {
“default_field” : “user”,
“query_string” : “rs_wisteria”
}
}
}’
7. 8. 9. $ curl -XGET 'localhost:9200/twitter/_search' -d '{
"facets" : {
"user" : {
"terms" : { "field" : "user" }
}
}
}'
10. 11. 12. 13. Ruby on Railsで利用する場合
◦ Gemfileに以下を追加し、bundle install
を実行
gem 'tire', :git => 'https://github.com/karmi/tire.git'
14. class Tweet < ActiveRecord::Base
include Tire::Model::Search
include Tire::Model::Callbacks
settings :number_of_shards => 1,
:number_of_replicas => 1 do
mapping {
indexes :user, :type => ‘string’
indexes :message, :type => ‘string’
}
end
end
15. rake tire:import:model
◦ 既にDBにデータがある場合、rakeのタス
クでElasticsearchにデータのインポート
が出来る
以下のコマンドでmapping定義を作成し、
データの投入を行う
$ bundle exec rake tire:import:model CLASS=‘twitter’
FORCE=true
16. 17. 18. 19. {
"items" : {
"settings" : {
"index.analysis.analyzer.kuromoji_analyzer.tokenizer" : "kuromoji_tokenizer",
"index.analysis.tokenizer.ngram.min_gram" : "2",
"index.number_of_replicas" : "1",
"index.analysis.tokenizer.ngram.max_gram" : "3",
"index.analysis.analyzer.ngram_analyzer.tokenizer" : "ngram",
"index.analysis.analyzer.kuromoji_analyzer.type" : "custom",
"index.analysis.analyzer.ngram_analyzer.type" : "custom",
"index.number_of_shards" : "1",
"index.analysis.tokenizer.ngram.type" : "nGram",
"index.version.created" : "900099"
}
}
}
20. 21.