I'm having some weird behavior with elastic search. I'm using custom analyzer with custom tokenizer which spilts the words in case of space, + , -.
when I'm searching
{
"query": {
"match_phrase_prefix": {
"name.default": {
"query": "paris oly"
}
}
}
}
I get results as expected paris olympia etc... but when I'm searching
{
"query": {
"match_phrase_prefix": {
"name.default": {
"query": "paris ol"
}
}
}
}
I get no results at all.
settings:
"analysis": {
"analyzer": {
"customAnalyzer": {
"type": "custom",
"filter": "lowercase",
"tokenizer": "customTokenizer"
},
"tokenizer": {
"customTokenizer": {
"pattern": "[\\+\\s-]",
"type": "pattern"
}
}
}
field mapping:
{
"name": {
"properties": {
"default": {
"type": "string",
"analyzer": "customAnalyzer"
}
}
}
}
sample of part of the doc (the requested field):
{
"name": {
"jp": "パリ オリンピア (劇場)",
"default": "Paris Olympia",
}
}
{
"TYPE_NAME": {
"dynamic_templates": [
{
"name": {
"path_match": "*name.*",
"match_mapping_type": "string",
"mapping": {
"type": "string",
"analyzer": "customAnalyzer"
}
}
}
],
"properties": {
"point": {
"type": "geo_point"
}
}
}
}