Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
260
Jane & Webby
odolbeau
0
440
Translating a monolingual application
odolbeau
2
630
DX: Developer eXperience
odolbeau
1
100
DX: Developer eXperience
odolbeau
1
560
EasyAdminBundle introduction
odolbeau
0
190
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
580
Other Decks in Programming
See All in Programming
AI Agent Dojo #4: watsonx Orchestrate ADK体験
oniak3ibm
PRO
0
110
モデル駆動設計をやってみようワークショップ開催報告(Modeling Forum2025) / model driven design workshop report
haru860
0
280
令和最新版Android Studioで化石デバイス向けアプリを作る
arkw
0
430
これならできる!個人開発のすゝめ
tinykitten
PRO
0
120
「コードは上から下へ読むのが一番」と思った時に、思い出してほしい話
panda728
PRO
39
26k
認証・認可の基本を学ぼう後編
kouyuume
0
250
Patterns of Patterns
denyspoltorak
0
190
メルカリのリーダビリティチームが取り組む、AI時代のスケーラブルな品質文化
cloverrose
2
330
ELYZA_Findy AI Engineering Summit登壇資料_AIコーディング時代に「ちゃんと」やること_toB LLMプロダクト開発舞台裏_20251216
elyza
2
550
バックエンドエンジニアによる Amebaブログ K8s 基盤への CronJobの導入・運用経験
sunabig
0
170
AI時代を生き抜く 新卒エンジニアの生きる道
coconala_engineer
1
400
組み合わせ爆発にのまれない - 責務分割 x テスト
halhorn
1
160
Featured
See All Featured
Writing Fast Ruby
sferik
630
62k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
200
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
29
A designer walks into a library…
pauljervisheath
210
24k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
91
Speed Design
sergeychernyshev
33
1.4k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
Darren the Foodie - Storyboard
khoart
PRO
0
1.9k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
The Curse of the Amulet
leimatthew05
0
4.6k
Context Engineering - Making Every Token Count
addyosmani
9
540
For a Future-Friendly Web
brad_frost
180
10k
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