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
240
Jane & Webby
odolbeau
0
410
Translating a monolingual application
odolbeau
2
590
DX: Developer eXperience
odolbeau
1
98
DX: Developer eXperience
odolbeau
1
550
EasyAdminBundle introduction
odolbeau
0
180
REX API Platform
odolbeau
0
1.3k
Features flags at BlaBlaCar
odolbeau
5
1.1k
25+ million members in 22 countries, how to scale with Symfony2
odolbeau
2
520
Other Decks in Programming
See All in Programming
あなたとKaigi on Rails / Kaigi on Rails + You
shimoju
0
170
釣り地図SNSにおける有料機能の実装
nokonoko1203
0
190
Things You Thought You Didn’t Need To Care About That Have a Big Impact On Your Job
hollycummins
0
250
Devvox Belgium - Agentic AI Patterns
kdubois
1
130
Catch Up: Go Style Guide Update
andpad
0
240
Claude Agent SDK を使ってみよう
hyshu
0
1.3k
技術的負債の正体を知って向き合う
irof
0
210
TransformerからMCPまで(現代AIを理解するための羅針盤)
mickey_kubo
3
1.1k
実践Claude Code:20の失敗から学ぶAIペアプログラミング
takedatakashi
16
6.4k
Cursorハンズオン実践!
eltociear
2
1.2k
大規模アプリのDIフレームワーク刷新戦略 ~過去最大規模の並行開発を止めずにアプリ全体に導入するまで~
mot_techtalk
1
470
Writing Better Go: Lessons from 10 Code Reviews
konradreiche
2
5.1k
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
22k
For a Future-Friendly Web
brad_frost
180
10k
How to Think Like a Performance Engineer
csswizardry
27
2.1k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
The World Runs on Bad Software
bkeepers
PRO
72
11k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.9k
Code Review Best Practice
trishagee
72
19k
Keith and Marios Guide to Fast Websites
keithpitt
411
23k
Testing 201, or: Great Expectations
jmmastey
45
7.7k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
190
55k
Designing Experiences People Love
moore
142
24k
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