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
PyBR12
Search
Patty Vader
October 12, 2016
Programming
68
0
Share
PyBR12
Patty Vader
October 12, 2016
More Decks by Patty Vader
See All by Patty Vader
Python para Machine Learning
pattyvader
0
35
Search Engines using Python and Elasticsearch
pattyvader
0
190
Pygame
pattyvader
0
87
GitHubWTM
pattyvader
0
50
Other Decks in Programming
See All in Programming
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
150
[2026年度第1回ORセミナー] 計画最適化ベンチャーと競技プログラミング人材
terryu16
0
230
関係性から理解する"同一性"の型用語たち
pvcresin
2
630
権限チェックの一貫性を型で守る TypeScript による多層防御
mnch
4
1k
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
7
3k
軽量Java基盤の設計 DIコンテナに頼らない、長期保守と1秒起動の実現 JJUG CCC 2026 Spring
macha64
0
360
LLM Plugin for Node-REDの利用方法と開発について
404background
0
150
初めてのRubyKaigiはこう見えた
jellyfish700
0
400
New "Type" system on PicoRuby
pocke
1
410
Copilot CLI の継戦能力を高める コンテキスト管理
nozomutu
1
1.2k
AIとRubyの静的型付け
ukin0k0
0
510
3Dシーンの圧縮
fadis
1
570
Featured
See All Featured
From π to Pie charts
rasagy
0
200
The Curious Case for Waylosing
cassininazir
1
370
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
310
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.7k
Typedesign – Prime Four
hannesfritz
42
3.1k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
Navigating Team Friction
lara
192
16k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
GraphQLとの向き合い方2022年版
quramy
50
15k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
830
Evolving SEO for Evolving Search Engines
ryanjones
0
210
Designing for humans not robots
tammielis
254
26k
Transcript
Search Engines utilizando Python e Elasticsearch
Apresentação https://spekerdeck.com/pattyvader/pybr12
Projeto Athena https://github.com/pattyvader/athena
Roadmap 1. Busca de documentos 2. Indexação 3. Percorrendo a
web
Busca de documentos
Busca de documentos Resultado armazenado no Elasticsearch Termo de busca
Busca de documentos Servidor de aplicação com Django GET Browser
(HTML)
Servidor de aplicação com Django Busca de documentos GET Browser
(HTML)
Busca de documentos . Servidor de aplicação com Django
Busca de documentos views.py Acessar o método “search” Servidor de
aplicação com Django
Busca de documentos views.py Acessar o método “search” Acessar o
método “search_term” Servidor de aplicação com Django
Indexação https://www.elastic.co/downloads/elasticsearch Relevancy score Protocolo Restful Mensagens Json
Indexação Relevance score
Indexação Restful/Json PUT GET
Indexação https://www.elastic.co/use-cases
Indexação O processo de indexação utiliza a lib Elasticsearch-py para
conectar o Python com o Elasticsearch. indexer.py https://pypi.python.org/pypi/elasticsearch https://elasticsearch-py.readthedocs.io/en/master/ https://github.com/elastic/elasticsearch-py Cria um índice Adiciona uma nova página ao índice
Indexação scraper.py O scraper extrai os dados, do arquivo html,
utilizando a lib BeautifulSoup. https://www.crummy.com/software/BeautifulSoup/
scraper.py Indexação Metatags do html
Percorrendo a web - Web crawler crawler.py
Percorrendo a web - Web crawler 1 3 2 4
5 Acessa arquivo robot.txt Download do html Extraí novos links Extraí os dados Insere dados no elasticsearch indexer.py scraper.py crawler.py
Percorrendo a web - Web crawler Antes de “crawlear” uma
página sempre verifique o arquivo “robot.txt”. É uma boa prática. crawler.py
Percorrendo a web - Web crawler A “urllib2” retorna o
html da página. crawler.py
Percorrendo a web- Web crawler crawler.py A extração de novos
links é realizada somente no domínio da url seed.
Percorrendo a web- Web crawler Método que realiza a extração
dos dados presentes no html. scraper.py crawler.py
Percorrendo a web- Web crawler Método que realiza a indexação
das páginas no Elasticsearch. indexer.py crawler.py
Finalizando... Browser (HTML) GET Servidor de aplicação com Django scraper.py
crawler.py indexer.py GET internet
https://github.com/pattyvader https://br.linkedin.com/in/patricia-regina-18790040 Contato *Designed by Freepik from www.flaticon.com*
[email protected]