Hi,
I am quite puzzled by using analyzer on one of my search fields. Here is the mapping:
{"settings": {
"analysis": {
"filter": {
"filter_shingle":{
"type":"shingle",
"max_shingle_size":3,
"min_shingle_size":2,
"output_unigrams":"true"
},
"tf_eng_stop": {
"type": "stop",
"stopwords": "_english_"
},
"tf_title_stop": {
"type": "stop",
"stopwords": ["intern", "internship", "senior", "Sr.", "Sr"]
},
"tf_synonym": {
"type": "synonym",
"synonyms_path" : "synonyms.txt"
}
},
"analyzer": {
"tf_synonym_analyzer": {
"tokenizer": "whitespace",
"filter": [
"lowercase",
"tf_eng_stop",
"tf_synonym"
]
},
"tf_title_analyzer": {
"tokenizer": "standard",
"filter": [
"lowercase",
"tf_title_stop",
"standard",
"filter_shingle"
]
},
"tf_synonym_analyzer_keyword_only":{
"tokenizer": "whitespace",
"filter": [
"lowercase",
"tf_eng_stop",
"tf_synonym"
]
}
}
}
},
"mappings":{
"job":{
"properties":{
"name":{
"type":"text"
},
"keywords":{
"type":"text",
"analyzer":"tf_synonym_analyzer"
},
"alias":{
"type":"text"
},
"color":{
"type":"text"
},
"id":{
"type":"long"
}
}
}
}
}
Here is the query:
_search
{
"query":{
"match_phrase":{
"alias":{
"query":"senior staff engineer/ manager",
"analyzer":"tf_title_analyzer",
"boost":1.5
}
}
},
"_source":{
"includes":[
"name",
"color"
]
},
"highlight":{
"fields":{
"alias":{
}
}
}
}
I noticed if the query is "senior staff engineer", nothing comes up. If I use "staff engineer", it returns a result. I am not sure why since I specified the query to use a stop word token filter already. Can someone help?
Thanks a lot!