Currently what I want to do is to treat the elasticSearch highlight query whitespace as a logical and because for example when I give it the following query
"New Zealand" | (flutter | This part should be treated as logical and words)
The part after the flutter is broken down as logical OR but I don't want this behavior.
I can't find anything in the docs that is helpful.
I tried using require field match but it doesn't help in this case
This is my current highlight
highlight: {
number_of_fragments: 5,
fragment_size: 100,
require_field_match: 'true',
pre_tags: ['<mark style="background-color: #ffff00;">'],
post_tags: ['</mark>'],
fields: [
{
title: {
number_of_fragments: 0,
},
},
{
description: {
number_of_fragments: 0,
},
},
{
'attrs.prettyName': {
number_of_fragments: 0,
},
},
],
},
As I have mentioned in comment, it is due to the existing highlighting open issue in Elasticsearch as mentioned in this issue.
There are some workaround mentioned in issue comments that you can try it out.