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-faceted-navigation.md
-36Lines changed: 0 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -180,42 +180,6 @@ To guarantee accuracy, you can artificially inflate the count:\<number> to a lar
180
180
181
181
The tradeoff with this workaround is increased query latency, so use it only when necessary.
182
182
183
-
<!--
184
-
## Presentation layer
185
-
186
-
In application code, the pattern is to use facet query parameters to return the faceted navigation structure along with facet results, plus a `$filter` expression. The filter expression handles the click event and further narrows the search result based on the facet selection.
187
-
188
-
### Facet and filter combination
189
-
190
-
The following code snippet from the `JobsSearch.cs` file in the [NYCJobs demo](/samples/azure-samples/search-dotnet-asp-net-mvc-jobs/search-dotnet-asp-net-mvc-jobs/) adds the selected Business Title to the filter if you select a value from the Business Title facet.
Here's another example from the hotels sample. The following code snippet adds `categoryFacet` to the filter if a user selects a value from the category facet.
198
-
199
-
```csharp
200
-
if (!String.IsNullOrEmpty(categoryFacet))
201
-
filter = $"category eq '{categoryFacet}'";
202
-
```
203
-
204
-
### Build HTML dynamically
205
-
206
-
The following code snippet from the `index.cshtml` (also from NYCJobs demo) dynamically builds the HTML to display the first facet, Business Title. Similar functions dynamically build the HTML for the other facets. Each facet has a label and a count, which displays the number of items found for that facet result.
0 commit comments