query = 'Ivan Atamanchuk Ivanovich'
highlighter is not working correctly when I put text above, it is just highlighting "Ivan Atamanchuk Ivanovich"
ignoring last "ovich", I approximately know why it is not highlighting, but I am struggling with realization
CODE:
body['query']['bool']['should'] = [
{'match': {'fullname.ngrams': {'query': query, 'operator': 'AND'}}}
]
if body['query']['bool'].get('should'):
body['query']['bool']['minimum_should_match'] = 1
body['highlight'] = {
"fields": [
{
"fullname.ngrams": {}
},
SETTINGS:
index_settings = {
'settings': {
'number_of_shards': 1,
'number_of_replicas': 0,
'analysis': {
'tokenizer': {
'custom_edge_ngram_tokenizer': {
'type': 'edge_ngram',
'min_gram': '1',
'max_gram': '100',
'token_chars': [
'letter',
'digit',
'custom'
],
"custom_token_chars": "+-_"
}
},
'analyzer': {
'custom_edge_ngram_analyzer': {
'tokenizer': 'custom_edge_ngram_tokenizer',
'filter': [
'lowercase'
]
}
}
}
},
'mappings': {
'properties': {
'fullname': {
'type': 'text',
'term_vector': 'with_positions_offsets',
'fields': {
'ngrams': {
'type': 'text',
'search_analyzer': 'standard',
'analyzer': 'custom_edge_ngram_analyzer',
'term_vector': 'with_positions_offsets'
}
}
}
}
}
}