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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
280
Jane & Webby
odolbeau
0
460
Translating a monolingual application
odolbeau
2
670
DX: Developer eXperience
odolbeau
1
110
DX: Developer eXperience
odolbeau
1
570
EasyAdminBundle introduction
odolbeau
0
200
REX API Platform
odolbeau
0
1.4k
Features flags at BlaBlaCar
odolbeau
5
1.2k
25+ million members in 22 countries, how to scale with Symfony2
odolbeau
2
640
Other Decks in Programming
See All in Programming
Basic Architectures
denyspoltorak
0
660
フルサイクルエンジニアリングをAI Agentで全自動化したい 〜構想と現在地〜
kamina_zzz
0
400
TerraformとStrands AgentsでAmazon Bedrock AgentCoreのSSO認証付きエージェントを量産しよう!
neruneruo
4
2.7k
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
110
なるべく楽してバックエンドに型をつけたい!(楽とは言ってない)
hibiki_cube
0
140
Fluid Templating in TYPO3 14
s2b
0
130
AIエージェントのキホンから学ぶ「エージェンティックコーディング」実践入門
masahiro_nishimi
3
270
メルカリのリーダビリティチームが取り組む、AI時代のスケーラブルな品質文化
cloverrose
2
510
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
SourceGeneratorのススメ
htkym
0
190
CSC307 Lecture 04
javiergs
PRO
0
650
Amazon Bedrockを活用したRAGの品質管理パイプライン構築
tosuri13
4
240
Featured
See All Featured
Paper Plane (Part 1)
katiecoart
PRO
0
4k
Accessibility Awareness
sabderemane
0
48
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
110
Producing Creativity
orderedlist
PRO
348
40k
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Done Done
chrislema
186
16k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.8k
Paper Plane
katiecoart
PRO
0
46k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3k
Utilizing Notion as your number one productivity tool
mfonobong
2
210
Balancing Empowerment & Direction
lara
5
880
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