|
GET / |
|
|
|
#### 1ST PART CRUD |
|
DELETE villes |
|
PUT villes |
|
{ |
|
"settings": { |
|
"number_of_shards": 1 |
|
} |
|
} |
|
PUT villes/_doc/cergy |
|
{ |
|
"message": "Ici c'est Cergy" |
|
} |
|
GET villes/_doc/cergy |
|
PUT villes/_doc/cergy |
|
{ |
|
"message": "Ici c'est Cergy", |
|
"meteo": "nuageux" |
|
} |
|
GET villes/_doc/cergy |
|
DELETE villes/_doc/cergy |
|
GET villes/_doc/cergy |
|
POST villes/_doc/ |
|
{ |
|
"message": "Ici c'est Cergy", |
|
"meteo": "nuageux", |
|
"nom": "Cergy" |
|
} |
|
# Just one or two |
|
POST villes/_doc/ |
|
{ |
|
"message": "Ici c'est Cergy Pontoise", |
|
"meteo": "nuageux", |
|
"nom": "Cergy Pontoise" |
|
} |
|
POST villes/_doc/ |
|
{ |
|
"message": "Ici c'est Lille", |
|
"meteo": "beau", |
|
"nom": "Lille" |
|
} |
|
# Look at inelastic for meteo field |
|
|
|
#### SEARCH |
|
GET villes/_search |
|
|
|
GET villes/_search |
|
{ |
|
"query": { |
|
"match": { |
|
"message": "cergy" |
|
} |
|
} |
|
} |
|
GET villes/_search |
|
{ |
|
"query": { |
|
"match": { |
|
"message": "CERGY!" |
|
} |
|
} |
|
} |
|
GET villes/_search |
|
{ |
|
"query": { |
|
"match": { |
|
"message": "cergy pontoise" |
|
} |
|
} |
|
} |
|
|
|
#### 2nd Part: INJECTOR |
|
|
|
# Inject data |
|
# Run aggregations |
|
# Play in Kibana |
|
# Show monitoring |
|
# Scale Out |
|
|
|
GET person/_search?track_total_hits=true |
|
|
|
# Back To Slides |
|
|
|
#### 3RD PART ANALYZE |
|
POST _analyze |
|
{ |
|
"text": [ "The quick brown fox jumps over the lazy Dog!" ] |
|
} |
|
POST _analyze |
|
{ |
|
"analyzer": "english", |
|
"text": [ "The quick brown fox jumps over the lazy Dog!" ] |
|
} |
|
|
|
# Start with ... And add the other filters |
|
POST _analyze |
|
{ |
|
"tokenizer": "standard", |
|
"filter": [ |
|
"lowercase" |
|
], |
|
"text": [ "L'éléphant est ROSE et il trompe énormément !" ] |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
POST _analyze |
|
{ |
|
"explain": true, |
|
"tokenizer": "standard", |
|
"filter": [ |
|
"lowercase", |
|
{"type": "stop", "stopwords": [ "_french_" ]}, |
|
{"type": "elision", "articles" : ["l", "m", "t", "qu", "n", "s", "j"]}, |
|
{"type": "stemmer", "name": "light_french"}, |
|
"asciifolding" |
|
], |
|
"text": [ "L'éléphant est ROSE et il trompe énormément !" ] |
|
} |
|
POST _analyze |
|
{ |
|
"analyzer": "french", |
|
"text": [ "L'éléphant est ROSE et il trompe énormément !" ] |
|
} |
|
|
|
## Not so light |
|
POST _analyze |
|
{ |
|
"tokenizer": "standard", |
|
"filter": [ |
|
"lowercase", |
|
{"type": "stop", "stopwords": [ "_french_" ]}, |
|
{"type": "elision", "articles" : ["l", "m", "t", "qu", "n", "s", "j"]}, |
|
{"type": "stemmer", "name": "french"}, |
|
"asciifolding" |
|
], |
|
"text": [ "L'éléphant est ROSE et il trompe énormément !" ] |
|
} |
|
POST _analyze |
|
{ |
|
"tokenizer": "standard", |
|
"filter": [ |
|
"lowercase", |
|
{"type": "stop", "stopwords": [ "_french_" ]}, |
|
{"type": "elision", "articles" : ["l", "m", "t", "qu", "n", "s", "j"]}, |
|
{"type": "stemmer", "name": "french"}, |
|
"asciifolding" |
|
], |
|
"text": [ "Des éléphantes" ] |
|
} |
|
|
|
|
|
## Bizarre ? |
|
POST _analyze |
|
{ |
|
"analyzer": "french", |
|
"text": [ "Un avion" ] |
|
} |
|
POST _analyze |
|
{ |
|
"analyzer": "french", |
|
"text": [ "Des avions" ] |
|
} |
|
|
|
|
|
## Ngrams |
|
POST _analyze |
|
{ |
|
"tokenizer": "standard", |
|
"filter": [ |
|
{"type": "edgeNGram", "min_gram" : 2, "max_gram" : 5} |
|
], |
|
"text": [ "eleph" ] |
|
} |
|
|
|
POST _analyze |
|
{ |
|
"tokenizer": "standard", |
|
"filter": [ |
|
{"type": "nGram", "min_gram" : 2, "max_gram" : 3} |
|
], |
|
"text": [ "eleph" ] |
|
} |
|
|
|
DELETE mon_index |
|
PUT mon_index |
|
{ |
|
"settings": { |
|
"number_of_shards": 1, |
|
"number_of_replicas": 0, |
|
"analysis": { |
|
"analyzer": { |
|
"francais": { |
|
"type": "custom", |
|
"tokenizer": "standard", |
|
"filter": [ |
|
"lowercase", |
|
"stop_francais", |
|
"fr_stemmer", |
|
"asciifolding", |
|
"elision" |
|
] |
|
}, |
|
"autocomplete": { |
|
"type": "custom", |
|
"tokenizer": "standard", |
|
"filter": [ |
|
"elision", |
|
"lowercase", |
|
"asciifolding", |
|
"autocomplete" |
|
] |
|
} |
|
}, |
|
"filter": { |
|
"stop_francais": { |
|
"type": "stop", |
|
"stopwords": [ |
|
"_french_", |
|
"twitter" |
|
] |
|
}, |
|
"fr_stemmer": { |
|
"type": "stemmer", |
|
"name": "french" |
|
}, |
|
"elision": { |
|
"type": "elision", |
|
"articles": [ |
|
"l", |
|
"m", |
|
"t", |
|
"qu", |
|
"n", |
|
"s", |
|
"j", |
|
"d", |
|
"lorsqu" |
|
] |
|
}, |
|
"autocomplete": { |
|
"type": "edgeNGram", |
|
"min_gram": 2, |
|
"max_gram": 5 |
|
} |
|
} |
|
} |
|
}, |
|
"mappings": { |
|
"properties": { |
|
"description": { |
|
"type": "text", |
|
"analyzer": "francais" |
|
}, |
|
"username": { |
|
"type": "text", |
|
"analyzer": "autocomplete", |
|
"search_analyzer": "simple" |
|
}, |
|
"city": { |
|
"type": "text", |
|
"analyzer": "francais", |
|
"fields": { |
|
"ngram": { |
|
"type": "text", |
|
"analyzer": "autocomplete", |
|
"search_analyzer": "simple" |
|
}, |
|
"raw": { |
|
"type": "keyword" |
|
} |
|
} |
|
} |
|
} |
|
|
|
} |
|
} |
|
POST mon_index/_analyze |
|
{ |
|
"text": [ "Cergy", "Cénac" ], |
|
"analyzer": "autocomplete" |
|
} |
|
POST mon_index/_analyze |
|
{ |
|
"text": [ "Cer" ], |
|
"analyzer": "autocomplete" |
|
} |
|
POST mon_index/_analyze |
|
{ |
|
"text": [ "Cer" ], |
|
"analyzer": "simple" |
|
} |
|
POST mon_index/_analyze |
|
{ |
|
"text": [ "J'habite à Cergy" ], |
|
"analyzer": "francais" |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|