I cannot highlight my search result when using span:{near:{…}}
I get an error like this
Reason: PlanExecutor error during aggregation :: caused by :: Remote error from mongot :: caused by :: Duplicate key text (attempted merging values $type:string/text and $type:string/text)
by typing this query
{
index: "simple",
span: {
near: {
clauses: [
{
term: {
path: "text",
query: "stöd"
}
},
{
term: {
path: "text",
query: "till"
}
},
{
term: {
path: "text",
query: "start"
}
}
],
slop: 5,
inOrder: false
}
},
highlight:{path:'text'}
}
but if I remove the higlight-part my query returns the expected result:
{
index: "simple",
span: {
near: {
clauses: [
{
term: {
path: "text",
query: "stöd"
}
},
{
term: {
path: "text",
query: "till"
}
},
{
term: {
path: "text",
query: "start"
}
}
],
slop: 5,
inOrder: false
}
}
}
This is only an issue for span.
Please help me.