Reputation: 531
In NEST, Elasticsearch library for .NET. For highlighting on query.
In Highlight
method of NEST, How we can pass an array of actions as parameter to onFields(Action<HighlightFieldDescriptor<T>>[] fielddata)
method?
thanks.
Upvotes: 0
Views: 108
Reputation: 738
You could try the below:
var highlighters = new Action<HighlightFieldDescriptor<YourObject>>[3];
highlighters[0] = h => h.OnField("field1");
highlighters[1] = h => h.OnField("field2");
highlighters[2] = h => h.OnField("field3");
searchDescriptor.Highlight(h => h.OnFields(highlighters));
Upvotes: 1