// Data example { "labels" : [ // NOTE: order matters "en:fist", // First entry of the language is the label, "en:" can be used to indicate no label in case an aliase exists "en:hand", // others are aliases "fr:poing", // label "fr:poignet" // aliases }, } // Mapping example labels: { "properties": { "near_match": "case insentive, accent insensitive" "exact_match": "case sensitive, accent sensitive" (maybe not needed) "prefix": "case insensitive, accenten insensitive" "all": { // In every subfield analyzer of this all field use a pattern char filter to remove the language prefix // TODO: verify that we can do it with regex char filter otherwize we may need a custom analyzer in the extra plugin "properties": { "near_match": "case insentive, accent insensitive" "exact_match": "case sensitive, accent sensitive" (maybe not needed) "prefix": "case insensitive, accenten insensitive" } } } }, I'm ht, searching for poignet // labels.all.prefix should be the union of everything else FILTER { labels.all.prefix:poignet } // Other fields are only needed for ranking SHOULD DISMAX{ // DISMAX allows to keep only the best score and not not additive scoring of all the matches // Might be easier when it comes to combine this score to query independent factors labels.all.exact_match:poignet^10 labels.all.near_match:poignet^5 labels.exact_match:ht:poignet^100 labels.near_match:ht:poignet^50 labels.prefix:ht:poignet^25 labels.exact_match:fr:poignet^100 labels.near_match:fr:poignet^50 labels.prefix:fr:poignet^25 # Should only be needed if a fallback to en # is interesting for ranking labels.exact_match:en:poignet^100 labels.near_match:en:poignet^50 labels.prefix:en:poignet^25 } + rescoring with query independant factors (sitelink...)