I get an error :-
RequestError(400, 'illegal_argument_exception', 'failed to build synonyms')
with the following analyzer, but it works if I set lenient=true. Any insight into why I get an error and if there is any downside to the use of lenient=true ?
es.indices.create(index= "myIndex", body= {
"settings": {
"number_of_shards": 1,
"analysis": {
"filter": {
"shingle_filter":{
"type" : "shingle",
"max_shingle_size" : 2,
"min_shingle_size" : 2,
"output_unigrams" : "false",
"output_unigrams_if_no_shingles" : "true",
"enable_position_increments":"false"
},
"kill_filler": {
"type": "pattern_replace",
"pattern": ".*_.*",
"replace": ""
},
"graph_synonyms" : {
"lenient": "true", #### error if I remove this
"type" : "synonym_graph",
"synonyms_path" : "synonyms.txt"
},
},
"analyzer": {
"shingle_analyzer": {
"tokenizer": "standard",
"filter": [
"lowercase",
"stop",
"graph_synonyms",
"shingle_filter",
"kill_filler",
]
}
},
}
},
"mappings": {
"properties": {
"content": {
"type": "text",
"fields": {
"shingles": {
"type": "text",
"analyzer": "shingle_analyzer"
}
}
},
"my_join_field": {
"type": "join",
"relations": {
"document": "page"
}
}
}
}
})