You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _posts/2012-08-21-au-coeur-d-elasticsearch.markdown
+17-17Lines changed: 17 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,7 @@ Une fois le texte analysé et transformé, il faut maintenant le stocker dans un
54
54
55
55
Le contenu de l'index inversé ressemblera à ça:
56
56
57
-
Inverted Index:
57
+
Index Inversé:
58
58
59
59
"road" : {Doc1}
60
60
"distributed" : {Doc1}
@@ -67,7 +67,7 @@ Maintenant opérons de même pour la phrase suivante : Doc2 = 'ElasticSearch a d
67
67
68
68
L'index inversé ressemble maintenant à ça:
69
69
70
-
Inverted Index:
70
+
Index Inversé:
71
71
72
72
"road" : {Doc1}
73
73
"distributed" : {Doc1, Doc2}
@@ -83,23 +83,23 @@ Un index inversé peut être vu comme une base [clé: multiples valeurs](http://
83
83
84
84
Maintenant que nous avons une base clé - multiple valeurs, il est assez facile de faire une recherche sur un terme:
85
85
86
-
Get from index: "engine" => {Doc1,Doc2}
86
+
Récupérer dans l'index: "engine" => {Doc1,Doc2}
87
87
88
88
Les IDs des documents nous sont retournés.
89
89
90
90
## Indexer != Stocker
91
91
92
92
Si nous souhaitons que ce soit le document et non l'ID qui soit retourné, il faut stocker le document à côté.
93
93
94
-
Storage:
94
+
Stockage:
95
95
96
96
"Doc1":"Road to a Distributed Search Engine"
97
97
"Doc2":"ElasticSearch a distributed, RESTful Search Engine"
98
98
99
99
Il faut donc interroger les deux bases : l'index inversé puis la base clé-valeur contenant les documents.
100
100
101
-
Get from index: "engine" => {Doc1,Doc2}
102
-
Get from storage: Doc1 AND Doc2 => ["Road to a Distributed Search Engine", "ElasticSearch a distributed, RESTful Search Engine"]
101
+
Récupérer dans l'index: "engine" => {Doc1,Doc2}
102
+
Récupérer dans la base de stockage: Doc1 ET Doc2 => ["Road to a Distributed Search Engine", "ElasticSearch a distributed, RESTful Search Engine"]
103
103
104
104
Par défaut ElasticSearch [index et stocke](http://www.elasticsearch.org/guide/reference/mapping/source-field.html) la donnée de manière completement transparente pour l'utilisateur, mais ceci est [configurable](https://groups.google.com/d/msg/elasticsearch/k_YgO8xspXE/eqY_SHEwgCMJ).
105
105
@@ -110,23 +110,23 @@ Lors de l'indexation du premier document : 'Road to a Distributed Search Engine'
110
110
111
111
Si nous recherchons les mots initiaux dans l'index inversé, nous n'obtiendrons aucun résultat:
112
112
113
-
Get from index: "Road" => {}
114
-
Get from index: "Distributed" => {}
113
+
Récupérer dans l'index: "Road" => {}
114
+
Récupérer dans l'index: "Distributed" => {}
115
115
116
116
Les mots avaient été indexés en minuscule.
117
117
118
118
Il est donc important d'appliquer les mêmes Analysers pour l'indexation et la recherche. C'est le comportement par défaut dans ElasticSearch.
119
119
120
-
Search: "Road" => {}
121
-
Get from index: "road => {Doc1}
120
+
Recherche: "Road" => {}
121
+
Récupérer dans l'index: "road => {Doc1}
122
122
123
123
124
124
## Syntaxe de requête
125
125
126
126
127
127
Et si nous cherchions "(road OR path) AND search"
128
128
129
-
Inverted Index:
129
+
Index Inversé:
130
130
131
131
"road" : {Doc1}
132
132
"distributed" : {Doc1, Doc2}
@@ -137,12 +137,12 @@ Inverted Index:
137
137
138
138
Query:
139
139
140
-
Get from index: "road => {Doc1}
141
-
Get from index: "path => {}
142
-
Evaluate: (road OR path) => {Doc1}
143
-
Get from index: "search => {Doc1, Doc2}
144
-
Evaluate: (road OR path) AND search => {Doc1}
145
-
Return => {Doc1}
140
+
Récupérer dans l'index: "road => {Doc1}
141
+
Récupérer dans l'index: "path => {}
142
+
Evaluer: (road OU path) => {Doc1}
143
+
Récupérer dans l'index: "search => {Doc1, Doc2}
144
+
Evaluer: (road OU path) ET search => {Doc1}
145
+
Retourner => {Doc1}
146
146
147
147
A partir d'un index inversé nous pouvons commencer à construire des requêtes complexes
148
148
[Syntaxe des requêtes Lucene](http://lucene.apache.org/core/3_6_1/queryparsersyntax.html).
0 commit comments