Vous cherchez toujours dans vos données avec des SELECT * FROM person WHERE name like '%david%pilato%" ?
Au delà des performances obtenues, êtes-vous certain de renvoyer les résultats les plus pertinents pour vos utilisateurs d'abord ?
Venez découvrir comment un moteur de recherche vous aidera à répondre aux questions posées par vos utilisateurs, de manière pertinente et efficace, tout en apportant des fonctionnalités d'analyse des résultats et ce, quelque soit le volume...
4. Some data
CREATE TABLE user
(
name VARCHAR(100),
comments VARCHAR(1000)
);
INSERT INTO user VALUES ('David Pilato', 'Developer at elastic');
INSERT INTO user VALUES ('Malloum Laya', 'Worked with David at
french customs service');
INSERT INTO user VALUES ('David Gageot', 'Engineer at Google');
INSERT INTO user VALUES ('David David', 'Who is that guy?');
!4
5. Search on term
SELECT * FROM user WHERE name="David";
Empty set (0,00 sec)
!5
INSERT INTO user VALUES ('David Pilato', 'Developer at elastic');
INSERT INTO user VALUES ('Malloum Laya', 'Worked with David at
french customs service');
INSERT INTO user VALUES ('David Gageot', 'Engineer at Google');
INSERT INTO user VALUES ('David David', 'Who is that guy?');
6. Search like
SELECT * FROM user WHERE name LIKE "%David%";
+--------------+----------------------+
| name | comments |
+--------------+----------------------+
| David Pilato | Developer at elastic |
| David Gageot | Engineer at Google |
| David David | Who is that guy? |
+--------------+----------------------+
!6
INSERT INTO user VALUES ('David Pilato', 'Developer at elastic');
INSERT INTO user VALUES ('Malloum Laya', 'Worked with David at
french customs service');
INSERT INTO user VALUES ('David Gageot', 'Engineer at Google');
INSERT INTO user VALUES ('David David', 'Who is that guy?');
7. Search in two fields
SELECT * FROM user WHERE name LIKE "%David%" OR
comments LIKE "%David%";
+--------------+---------------------------------------------+
| name | comments |
+--------------+---------------------------------------------+
| David Pilato | Developer at elastic |
| Malloum Laya | Worked with David at french customs service |
| David Gageot | Engineer at Google |
| David David | Who is that guy? |
+--------------+---------------------------------------------+
!7
INSERT INTO user VALUES ('David Pilato', 'Developer at elastic');
INSERT INTO user VALUES ('Malloum Laya', 'Worked with David at
french customs service');
INSERT INTO user VALUES ('David Gageot', 'Engineer at Google');
INSERT INTO user VALUES ('David David', 'Who is that guy?');
10. Search with typos
SELECT * FROM user WHERE name LIKE "%Dadid%";
Empty set (0,00 sec)
!10
INSERT INTO user VALUES ('David Pilato', 'Developer at elastic');
INSERT INTO user VALUES ('Malloum Laya', 'Worked with David at
french customs service');
INSERT INTO user VALUES ('David Gageot', 'Engineer at Google');
INSERT INTO user VALUES ('David David', 'Who is that guy?');
11. Search with typos
SELECT * FROM user WHERE name LIKE "%_adid%" OR
name LIKE "%D_did%" OR
name LIKE "%Da_id%" OR
name LIKE "%Dad_d%" OR
name LIKE "%Dadi_%";
+--------------+----------------------+
| David Pilato | Developer at elastic |
| David Gageot | Engineer at Google |
| David David | Who is that guy? |
+--------------+----------------------+
!11
INSERT INTO user VALUES ('David Pilato', 'Developer at elastic');
INSERT INTO user VALUES ('Malloum Laya', 'Worked with David at
french customs service');
INSERT INTO user VALUES ('David Gageot', 'Engineer at Google');
INSERT INTO user VALUES ('David David', 'Who is that guy?');
15. Search for terms
SELECT * FROM user WHERE name LIKE "%David Pilato%";
+--------------+----------------------+
| name | comments |
+--------------+----------------------+
| David Pilato | Developer at elastic |
+--------------+----------------------+
!15
INSERT INTO user VALUES ('David Pilato', 'Developer at elastic');
INSERT INTO user VALUES ('Malloum Laya', 'Worked with David at
french customs service');
INSERT INTO user VALUES ('David Gageot', 'Engineer at Google');
INSERT INTO user VALUES ('David David', 'Who is that guy?');
16. Search with inverted terms
SELECT * FROM user WHERE name LIKE "%Pilato David%";
Empty set (0,00 sec)
SELECT * FROM user WHERE name LIKE "%Pilato%David%";
Empty set (0,00 sec)
!16
INSERT INTO user VALUES ('David Pilato', 'Developer at elastic');
INSERT INTO user VALUES ('Malloum Laya', 'Worked with David at
french customs service');
INSERT INTO user VALUES ('David Gageot', 'Engineer at Google');
INSERT INTO user VALUES ('David David', 'Who is that guy?');
17. Search for terms
SELECT * FROM user WHERE name LIKE "%David%" AND
name LIKE "%Pilato%";
+--------------+----------------------+
| name | comments |
+--------------+----------------------+
| David Pilato | Developer at elastic |
+--------------+----------------------+
!17
INSERT INTO user VALUES ('David Pilato', 'Developer at elastic');
INSERT INTO user VALUES ('Malloum Laya', 'Worked with David at
french customs service');
INSERT INTO user VALUES ('David Gageot', 'Engineer at Google');
INSERT INTO user VALUES ('David David', 'Who is that guy?');
19. Synonyms
SELECT * FROM user WHERE comments LIKE "%Engineer%";
+--------------+----------------------+
| name | comments |
+--------------+----------------------+
| David Gageot | Engineer at Google |
+--------------+----------------------+
!19
INSERT INTO user VALUES ('David Pilato', 'Developer at elastic');
INSERT INTO user VALUES ('Malloum Laya', 'Worked with David at
french customs service');
INSERT INTO user VALUES ('David Gageot', 'Engineer at Google');
INSERT INTO user VALUES ('David David', 'Who is that guy?');
20. Synonyms
SELECT * FROM user WHERE comments LIKE "%Developer%" OR
comments LIKE "%Engineer%";
+--------------+----------------------+
| name | comments |
+--------------+----------------------+
| David Pilato | Developer at elastic |
| David Gageot | Engineer at Google |
+--------------+----------------------+
!20
INSERT INTO user VALUES ('David Pilato', 'Developer at elastic');
INSERT INTO user VALUES ('Malloum Laya', 'Worked with David at
french customs service');
INSERT INTO user VALUES ('David Gageot', 'Engineer at Google');
INSERT INTO user VALUES ('David David', 'Who is that guy?');
21. Search like within 1 000 000 000 records…
SELECT * FROM user WHERE name LIKE "%David%";
!21