I get an error “Highlights can not be generated. Path: “company_name” is not stored statically or dynamically indexed”. The documentation has an highlights example for a dynamic search index.
I use query like this and without highlights it works fine.
[{ “$search” : { “compound” : { “should” : [{ “autocomplete” : { “path” : “company_name”, “query” : “amaz”, “tokenOrder” : “any”, “fuzzy” : { “prefixLength” : 1, “maxEdits” : 1, “maxExpansions” : 256 } } }] }, “highlight” : { “path” : “company_name” } } }, { “$limit” : 1000 }, { “$project” : { “_id” : 0, “company_name” : 1, “scout_id” : 2, “highlights” : { “$meta” : “searchHighlights” }, “score” : { “$meta” : “searchScore” } } }]
And can i make highlights for several should in compound?