You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/search/search-pagination-page-layout.md
+3-58Lines changed: 3 additions & 58 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,65 +103,10 @@ POST /indexes/hotels/docs/search?api-version=2019-05-06
103
103
}
104
104
```
105
105
106
-
### Improved highlighting capability (for services created after July 15, 2020)
107
-
108
-
> [!NOTE]
109
-
> Services created after July 15, 2020 will provide a new and improved highlighting experience. Services created before that date will not change in their highlighting behavior.
106
+
> [!IMPORTANT]
107
+
> Services created after July 15, 2020 will provide a different highlighting experience. Services created before that date will not change in their highlighting behavior. With this change, only phrases that match the full phrase query will be returned. Also, it will be possible to specify the fragment size returned for the highlight.
110
108
>
111
-
112
-
#### Highlight only the matching phrases with phrase queries.
113
-
Phrase queries enable searching of phrases in documents.
114
-
115
-
In services created before July 15, 2020, highlighting on phrase queries works by taking individual terms, regardless of their positions in the document, and including them in the response. After July 15, 2020, only the matching phrases will be highlighted.
116
-
117
-
For example, the query "super bowl" returns highlights like this:
118
-
119
-
```html
120
-
'<em>super</em> <em>bowl</em> is <em>super</em> awesome with a <em>bowl</em> of chips'
121
-
```
122
-
123
-
and requires client side filtering of terms. The newer experience will highlight only the phrase super bowl in the above text which is what matched the query:
124
-
125
-
```html
126
-
'<em>super bowl</em> is super awesome with a bowl of chips'
127
-
```
128
-
129
-
#### Improved experience with wildcard and fuzzy queries
130
-
In services created after July 15, 2020, highlighting with wildcard and fuzzy queries on fields with scoring profiles will be supported. Previously, highlighting was only supported for wildcard and fuzzy queries on fields without scoring profiles.
131
-
132
-
Let's look at a simple index and queries for clarification:
133
-
134
-
```http
135
-
{
136
-
"name": "simple-index",
137
-
"fields": [
138
-
{
139
-
"name": "key",
140
-
"type": "Edm.String"
141
-
},
142
-
{
143
-
"name": "simplefield",
144
-
"type": "Edm.String"
145
-
}
146
-
],
147
-
"scoringProfiles": [
148
-
{
149
-
"name": "boostedprofile",
150
-
"functionAggregation": null,
151
-
"text": {
152
-
"weights": {
153
-
"simplefield": 5,
154
-
}
155
-
},
156
-
"functions": []
157
-
}
158
-
]
159
-
}
160
-
```
161
-
162
-
Using a wildcard query *search=foo*&highlight=simplefield&querytype=full* will highlight all terms starting with *foo*. The same query when used with a scoring profile *search=foo*&highlight=simplefield&querytype=full&scoringprofile=boostedprofile* will do the same, whereas before these changes it would return no highlights.
163
-
164
-
109
+
> When you are writing client code that implements hit highlighting, be aware of this change. Note that this will not impact you unless you create a completely new search service.
0 commit comments