Files
iTunes/suggester.es
Maxence G. de Montauzan 8121f3d751 (back) Suggester V2: Process album data
(cherry picked from commit dd322405d047d49e51d528341cbd008d7a98b6ab)
2021-08-22 17:01:00 +02:00

80 lines
1.6 KiB
JavaScript

DELETE itunes-suggest
PUT /itunes-suggest
{
"settings": {
"analysis": {
"filter": {
"french_stop": {
"type": "stop",
"stopwords": "_french_"
},
"english_stop": {
"type": "stop",
"stopwords": "_english_"
}
},
"analyzer": {
"names": {
"tokenizer": "standard",
"filter": [
"lowercase",
"asciifolding",
"french_stop",
"english_stop"
]
}
}
}
},
"mappings": {
"properties": {
"artist_suggest": {
"type": "completion"
},
"artist": {
"type": "keyword"
},
"album_suggest": {
"type": "completion"
},
"album": {
"type": "keyword"
}
}
}
}
// Problem with word EP, SP
GET itunes-suggest/_analyze
{
"analyzer": "names",
"text": "the servent"
}
POST itunes-suggest/_search
{
"suggest": {
"name-suggest": {
"prefix": "sou",
"completion": {
"field": "artist_suggest"
}
}
}
}
POST itunes-suggest/_search
{
"suggest": {
"name-suggest": {
"prefix": "trip",
"completion": {
"field": "album_suggest",
"size": 20
}
}
}
}