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
This React component includes the search textbox and the [**facets**](search-faceted-navigation) associated with the search results. Facets need to be thought out and designed as part of the search schema when the search data is loaded. Then the facets are used in the search query, along with the search text, to provide the faceted navigation experience.
When the user changes the page, that value is sent to the parent `Search.js` page from the `handleChangePage` function. In the parent page, a change to the current page is detected which requires a new request is sent to the search API for the same query text and the new page. The API response results change the facets, results, and pager components.
47
61
48
62
## Azure Function: Suggestions from the catalog
49
63
@@ -57,7 +71,13 @@ The search suggester, `sg`, is defined in the [schema file](https://github.com/A
57
71
58
72
The Suggest function API is called in the React app at `\src\components\SearchBar\SearchBar.js` as part of component initialization:
This React component uses the `@mui/material/Autocomplete` component to provide a search textbox, which also supports displaying suggestions (using the `renderInput` function) as the user types in characters. When each character is entered, the search is sent to API. The API results are displayed as a short list of suggestions.
77
+
78
+
This autosuggest functionality is a common feature but this specific implementation has an additional use case. The customer can enter text and select from the suggestions _or_ submit their entered text. The input from the suggestion list as well as the input from the textbox must be tracked for changes, which impact how the form is rendered and what is sent to the **search** API when the form is submitted.
79
+
80
+
If your use case for search allows your user to select only from the suggestions, that will reduce the scope of complexity of the control but limit the user experience.
61
81
62
82
## Azure Function: Get specific document
63
83
@@ -69,7 +89,9 @@ The [Lookup API](https://github.com/Azure-Samples/azure-search-javascript-sample
69
89
70
90
This function API is called in the React app at `\src\pages\Details\Detail.js` as part of component initialization:
If your client app can use pregenerated content, this page is a good candidate for autogeneration because the content is static, pulled directly from the search index.
0 commit comments