PUT subfield-repro
{
"settings": {
"analysis": {
"analyzer": {
"reverser": {
"type": "custom",
"tokenizer": "keyword",
"filter": [
"lowercase",
"reverse"
]
},
"whole": {
"type": "custom",
"tokenizer": "keyword",
"filter": [
"lowercase"
]
}
}
}
},
"mappings": {
"type": {
"properties": {
"textfield": {
"type": "text",
"analyzer": "standard",
"boost": 3,
"fields": {
"whole": {
"boost": 2,
"analyzer": "whole",
"type": "text"
},
"reverse": {
"analyzer": "reverser",
"type": "text"
}
}
}
}
}
}
}
POST subfield-repro/type
{
"textfield" : "http://google.com/boots"
}
GET subfield-repro/type/_search
{
"query" : {
"match_phrase_prefix": {
"textfield": "http"
}
}
}
GET subfield-repro/type/_search
{
"query" : {
"match_phrase_prefix": {
"textfield.whole": "http"
}
}
}
GET subfield-repro/type/_search
{
"explain": true,
"query" : {
"match_phrase_prefix": {
"textfield.reverse": "boots"
}
}
}
However if you don't boost (or only boost with a value of 1), all 3 return results as expected.
PUT subfield-repro
{
"settings": {
"analysis": {
"analyzer": {
"reverser": {
"type": "custom",
"tokenizer": "keyword",
"filter": [
"lowercase",
"reverse"
]
},
"whole": {
"type": "custom",
"tokenizer": "keyword",
"filter": [
"lowercase"
]
}
}
}
},
"mappings": {
"type": {
"properties": {
"textfield": {
"type": "text",
"analyzer": "standard",
"boost": 3,
"fields": {
"whole": {
"analyzer": "whole",
"type": "text"
},
"reverse": {
"analyzer": "reverser",
"type": "text"
}
}
}
}
}
}
}