Reputation: 59
We recently upgraded azure ai search (acs) to version 11. We now have a new class SearchOptions.
We are not able to find the required property where we can mention no. of highlight count on a field.
Earlier it was possible through - "highlight": "description-10", where 10 returns the total highlight count of description field. By default it will be 5.
Could any of you please provide more details on same. Thank you for your help in advance.
In searchOptions class, i tried against field HighlightFields.
Ex : HighlightFields = {"Id", "Name-10"}, where id and name are column names.10 is no. of highlighted records expected. but still was returning 5.
Upvotes: 1
Views: 66
Reputation: 7975
As per this document below is the requirement for using highlight
.
- Fields must be
Edm.String
orCollection(Edm.String)
- Fields must be attributed at searchable
If not, please configure to meet the above requirements.
Next, according to this document the property of highlight
should be list of strings which is similar to select
and Orderby
.
Like how it is given in the code similar way you add the fields.
Sample for adding select
fields
options = new SearchOptions()
{
Filter = "Rooms/any(r: r/BaseRate lt 100)"
};
options.Select.Add("HotelId");
options.Select.Add("Description");
similarly add for highlight
options.HighlightFields.Add("Id");
options.HighlightFields.Add("Name-10");
Upvotes: 0