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.5k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Doctrine Lexer Use Case
PHPTour Lyon 2014 - 24/06/2014
Olivier Dolbeau
June 24, 2014
More Decks by Olivier Dolbeau
See All by Olivier Dolbeau
Throw new \Exception(); Oui, mais laquelle ?
odolbeau
1
340
Jane & Webby
odolbeau
0
510
Translating a monolingual application
odolbeau
2
700
DX: Developer eXperience
odolbeau
1
140
DX: Developer eXperience
odolbeau
1
590
EasyAdminBundle introduction
odolbeau
0
250
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
680
Other Decks in Programming
See All in Programming
PostgreSQL 18で考えるUUID主キー
kazuhiro1982
0
490
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
660
What's New in Android 2026
veronikapj
0
270
言葉の格闘技のススメ~紙とペンと言葉から始める、キャリアの描き方~
progresscicada
2
160
わからない話を追いかけたら、プログラミング言語を作る側にいた
ydah
3
520
VibeCodingからAgenticWorkflowへ
starfish719
0
670
実装をデザインガイドラインに追従させるための取り組み / 260731-dip-mosh-design-system
dachi023
0
5.8k
Detecting Compromised CI with eBPF and Cilium Tetragon
lizrice
0
210
KotlinConf Extended South Korea 2026 Keynote
l2hyunwoo
0
110
Built Our Own Background Agent at LayerX
layerx
PRO
10
5.8k
FDEが実現するAI駆動経営の現在地
gonta
2
290
変わらないものが、変わるものを決める — 意図駆動開発 × イベントソーシング × イミュータブル | What Doesn't Change Decides What Can — IDD × Event Sourcing × Immutability
tomohisa
0
1.8k
Featured
See All Featured
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
550
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.4k
Typedesign – Prime Four
hannesfritz
42
3.1k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
2
3.8k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
Designing for humans not robots
tammielis
254
26k
The Cult of Friendly URLs
andyhume
79
7k
SEO for Brand Visibility & Recognition
aleyda
0
4.7k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
350
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
940
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