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
ElasticSearch
Search
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.3k
Other Decks in Programming
See All in Programming
AI駆動開発4年目の現在地(『あなたはFDEになるべきか?』イベント資料)
kumaiu
0
550
GraphQL の onError と Nullability のこれから
quramy
0
210
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
4
3.7k
クラウドゲーミングのパフォーマンス最適化に挑む / Cloud Gaming Performance Tuning
vivion
0
330
DroidKnights 2026 Android A2UI Jetpack Compose 기반의 안전한 AI UI 렌더링 - 박제창
itsmedreamwalker
1
220
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
420
graphql-ruby を Spinel で速くしようとした話
mtsmfm
0
140
Rails初心者がパスキーを実装してみて大変だったこと
ktombow
0
160
Enforcing Your Architecture with Unit Tests in the AI Era (Swift Connection X)
steliosf
PRO
1
150
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
3
1.5k
現場と育てるRailsモデリング 〜Spreadsheetから始めたモデル設計〜
siroemk
2
1.2k
自作Discord音声botをLambda MicroVMsに移行した話 / Migrating My Discord Voice Bot to Lambda MicroVMs
akihisaikeda
1
300
Featured
See All Featured
The Spectacular Lies of Maps
axbom
PRO
1
1.1k
Designing for Timeless Needs
cassininazir
1
560
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
Automating Front-end Workflow
addyosmani
1370
210k
Making Projects Easy
brettharned
120
6.9k
A Tale of Four Properties
chriscoyier
163
24k
WCS-LA-2024
lcolladotor
0
990
Test your architecture with Archunit
thirion
2
2.5k
Visualization
eitanlees
153
17k
Rails Girls Zürich Keynote
gr2m
96
14k
Site-Speed That Sticks
csswizardry
13
1.6k
Designing for humans not robots
tammielis
254
26k
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)
спасибо спасибо