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
Doctrine Lexer Use Case
Search
Olivier Dolbeau
June 24, 2014
Programming
1
1.4k
Doctrine Lexer Use Case
PHPTour Lyon 2014 - 24/06/2014
Olivier Dolbeau
June 24, 2014
Tweet
Share
More Decks by Olivier Dolbeau
See All by Olivier Dolbeau
Throw new \Exception(); Oui, mais laquelle ?
odolbeau
1
210
Jane & Webby
odolbeau
0
390
Translating a monolingual application
odolbeau
2
550
DX: Developer eXperience
odolbeau
1
87
DX: Developer eXperience
odolbeau
1
540
EasyAdminBundle introduction
odolbeau
0
170
REX API Platform
odolbeau
0
1.3k
Features flags at BlaBlaCar
odolbeau
5
1k
25+ million members in 22 countries, how to scale with Symfony2
odolbeau
2
500
Other Decks in Programming
See All in Programming
Using AI Tools Around Software Development
inouehi
0
1.2k
KotlinConf 2025 現地で感じたServer-Side Kotlin
n_takehata
1
210
Gleamという選択肢
comamoca
6
700
Perplexity Slack Botを作ってAI活用を進めた話 / AI Engineering Summit プレイベント
n3xem
0
650
複数アプリケーションを育てていくための共通化戦略
irof
10
3.8k
PT AI без купюр
v0lka
0
230
WindowInsetsだってテストしたい
ryunen344
1
130
[初登壇@jAZUG]アプリ開発者が気になるGoogleCloud/Azure+wasm/wasi
asaringo
0
130
TypeScript LSP の今までとこれから
quramy
1
500
「兵法」から見る質とスピード
ickx
0
260
A comprehensive view of refactoring
marabesi
0
300
Javaに鉄道指向プログラミング (Railway Oriented Pro gramming) のエッセンスを取り入れる/Bringing the Essence of Railway-Oriented Programming to Java
cocet33000
2
540
Featured
See All Featured
Faster Mobile Websites
deanohume
307
31k
Practical Orchestrator
shlominoach
188
11k
4 Signs Your Business is Dying
shpigford
184
22k
Agile that works and the tools we love
rasmusluckow
329
21k
Facilitating Awesome Meetings
lara
54
6.4k
GitHub's CSS Performance
jonrohan
1031
460k
Code Reviewing Like a Champion
maltzj
524
40k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
123
52k
The Language of Interfaces
destraynor
158
25k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
780
Site-Speed That Sticks
csswizardry
10
630
Transcript
Doctrine Lexer use case
None
Olivier Dolbeau @odolbeau Web Architect About me
RIDESHARING Cost of motoring 100€ 25€ 25€ 25€ 25€ @BlaBlaCar_FR
ALONE
A fast growing community
A European phenomenon
None
I want to be able to search tweets using a
human language.
None
None
None
None
Where are my tweets ?
None
None
None
None
None
None
Other solutions Logstash Home made external river
distributed restful search and analytics elasticsearch
None
None
None
None
None
We know what we want. We know where our data
is.
Now let’s see HOW we are doing to retrieve it.
How... … to translate a human language into a technical
one.
“ A retweet FROM @CameronNash23 ”
None
What’s a Lexer ? In computer science, lexical analysis is
the process of converting a sequence of characters into a sequence of tokens, i. e. meaningful character strings.
Tokens ! Now !
None
None
None
None
“ A retweet FROM @CameronNash23 ” T_SELECTOR T_RETWEET T_FROM T_USERNAME
How... … to use these tokens to generate an ElasticSearch
query.
None
None
None
None
It works!
None
None
None
And what about Doctrine ORM ? Let’s take a look
at : Doctrine\ORM\Query\Lexer
From DQL to SQL SELECT t0.id AS id1, t0.name AS
name3, t0. username AS username4, t0.email AS email5 FROM mos_users t0 WHERE t0.username = “foobar” SELECT u FROM MyProject\Model\User u WHERE u.username = ‘foobar’
77 tokens !!
Some patterns...
And a switch (true) !
Forget the Parser !
None
None
None
Example A trip OR A search FROM "Paris, France" OR
TO "Paris, France" BETWEEN 12/01/2013 AND 26/05/2014 A trip OR A search FROM "Paris, France" OR TO "Paris, France" BETWEEN 12/01/2013 AND 26/05/2014
Lexer to GET tokens. Parser to USE tokens.
@odolbeau On recrute ! :) MERCI !
@odolbeau https://joind.in/ 11246 https://github.com/odolbeau/elasticsearch-sandbox https://speakerdeck.com/odolbeau/doctrine-lexer-use-case