Sto cercando di capire come configurare elasticsearch in modo che sia possibile effettuare ricerche di stringhe di query con caratteri jolly nei campi che includono trattini.Campi indice con trattini in Elasticsearch
devo documenti che assomigliano a questo:
{
"tags":[
"deck-clothing-blue",
"crew-clothing",
"medium"
],
"name":"Crew t-shirt navy large",
"description":"This is a t-shirt",
"images":[
{
"id":"ba4a024c96aa6846f289486dfd0223b1",
"type":"Image"
},
{
"id":"ba4a024c96aa6846f289486dfd022503",
"type":"Image"
}
],
"type":"InventoryType",
"header":{
}
}
ho cercato di utilizzare un filtro word_delimiter e un tokenizzatore spazio bianco:
{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 1
},
"analysis" : {
"filter" : {
"tags_filter" : {
"type" : "word_delimiter",
"type_table": ["- => ALPHA"]
}
},
"analyzer" : {
"tags_analyzer" : {
"type" : "custom",
"tokenizer" : "whitespace",
"filter" : ["tags_filter"]
}
}
}
},
"mappings" : {
"yacht1" : {
"properties" : {
"tags" : {
"type" : "string",
"analyzer" : "tags_analyzer"
}
}
}
}
}
ma queste sono le ricerche (per i tag) e la loro risultati:
deck* -> match
deck-* -> no match
deck-clo* -> no match
Qualcuno può vedere dove sto andando male?
Grazie :)
Cosa succede quando si rimuove il filtro? – concept47
La rimozione del filtro non sembra influire sui risultati della ricerca. –