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
0
64
PyBR12
Patty Vader
October 12, 2016
Tweet
Share
More Decks by Patty Vader
See All by Patty Vader
Python para Machine Learning
pattyvader
0
32
Search Engines using Python and Elasticsearch
pattyvader
0
190
Pygame
pattyvader
0
83
GitHubWTM
pattyvader
0
47
Other Decks in Programming
See All in Programming
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
990
[KNOTS 2026登壇資料]AIで拡張‧交差する プロダクト開発のプロセス および携わるメンバーの役割
hisatake
0
250
AI Agent Tool のためのバックエンドアーキテクチャを考える #encraft
izumin5210
6
1.8k
ThorVG Viewer In VS Code
nors
0
760
CSC307 Lecture 09
javiergs
PRO
1
830
例外処理とどう使い分ける?Result型を使ったエラー設計 #burikaigi
kajitack
16
6k
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
170
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
300
HTTPプロトコル正しく理解していますか? 〜かわいい猫と共に学ぼう。ฅ^•ω•^ฅ ニャ〜
hekuchan
2
680
Grafana:建立系統全知視角的捷徑
blueswen
0
330
ぼくの開発環境2026
yuzneri
0
110
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
2
1.8k
Featured
See All Featured
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
79
Building Applications with DynamoDB
mza
96
6.9k
Producing Creativity
orderedlist
PRO
348
40k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.4k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1.1k
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
Marketing to machines
jonoalderson
1
4.6k
The untapped power of vector embeddings
frankvandijk
1
1.6k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
180
Skip the Path - Find Your Career Trail
mkilby
0
53
Rebuilding a faster, lazier Slack
samanthasiow
85
9.4k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
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]