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
ElasticSearch
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
nyumatova
August 24, 2012
Programming
230
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ElasticSearch
nyumatova
August 24, 2012
More Decks by nyumatova
See All by nyumatova
Commit messages
nyumatova
5
3.2k
Other Decks in Programming
See All in Programming
New "Type" system on PicoRuby
pocke
1
790
並列実装の現場、2ヶ月間実務でAIを使い倒したAIもPCも私も限界が近い
ming_ayami
0
120
The ROI of Quarkus for Spring Boot Applications
hollycummins
0
100
These Five Tricks Can Make Your Apps Greener, Cheaper, & Nicer
hollycummins
0
280
Composerを使ったサプライチェーン攻撃の様子を眺めてみる #phpstudy
o0h
PRO
2
240
AI時代のUIはどこへ行く?その2!
yusukebe
20
7k
Why Laravel apps break—Mastering the fundamentals to keep them maintainable
kentaroutakeda
1
350
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
tk3fftk
5
700
JJUG CCC 2026 Spring: JSpecify で実現する Kotlin フレンドリーな Java API 設計
ternbusty
1
160
DynamoDBには集計系のクエリがないけどなんとかしたい
musan
1
130
技術記事、AIに書かせるか、自分で書くか? 〜それでも私が自分の手で書く理由〜 / #QiitaConference
jnchito
2
1.3k
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.6k
Featured
See All Featured
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
250
The Cost Of JavaScript in 2023
addyosmani
55
10k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
320
Rebuilding a faster, lazier Slack
samanthasiow
85
9.5k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.7k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.9k
Believing is Seeing
oripsolob
1
140
Building the Perfect Custom Keyboard
takai
2
790
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
150
Six Lessons from altMBA
skipperchong
29
4.3k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
400
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Transcript
Полнотекстовый поиск Полнотекстовый поиск
Зачем? Зачем? Ответ прост - производительность
Какой выбор? Какой выбор? Elastic Search Solr Xapian Sphinx
Почему ElasticSearch? Почему ElasticSearch? Хорошая поддержка русского языка Прост в
установке и настройке Удобная работа с индексами Приятный Query DSL (domain-specific language) pyes и elasticutils (от mozilla) Индексация в режиме реального времени
elasticutils (pyes): индексы elasticutils (pyes): индексы from elasticutils import get_es
connector = get_es(hosts=['127.0.0.1:9200']) connector.delete_index_if_exists('crm') connector.create_index('crm', settings=SETTINGS) connector.put_mapping('clients', { 'properties': CLIENTS_MAPPING, '_type': {'store': 'yes'} }, ['crm']) connector.put_mapping('contacts', { 'properties': CONTACTS_MAPPING, '_type': {'store': 'yes'} }, ['crm'])
ElasticSearch REST API curl ElasticSearch REST API curl $ curl
-‐XGET 'http://localhost:9200/crm/_search' -‐d '{ 'filter': { 'and': [{'term': {'_type': u'clients'}}, {'term': {'is_client': True}}] }, 'query': { 'query_string': {'query': u'петров', 'default_field': 'content'} }, 'sort': [{u'modified_on': 'desc'}], 'from': 15, 'size': 5, 'fields': ['id'] }'
elasticutils elasticutils Удобный Django-QuerySet-like API для работы с ElasticSearch
elasticutils: базовый класс elasticutils: базовый класс from elasticutils import S
searcher = S().indexes('crm')
elasticutils: query elasticutils: query ... query = u'иванов' searcher =
searcher.query( content__query_string=query )
elasticutils: filter elasticutils: filter ... kwargs = {'is_client': True} searcher
= searcher.filter(**kwargs)
elasticutils: order_by elasticutils: order_by ... order_by = '-‐title' searcher =
searcher.order_by(order_by)
спасибо спасибо