-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(headless): Support the automatic query correction feature for th…
…e insight use case (#4598) [SFINT-5680](https://coveord.atlassian.net/browse/SFINT-5680) ## IN THIS PR: 1- We now allow the SAPI to automatically correct the queries that contain a typo. This was done by specifying the parameter queryCorrection in the search request for the insight panel. To support this in the Headless library we needed to update [ Insight Search Actions Thunk Processor](https://github.com/coveo/ui-kit/blob/master/packages/headless/src/features/insight-search/insight-search-actions-thunk-processor.ts) by adding a new logic to the `processQueryCorrectionsOrContinue` that handles the query correction feature using the **modern** way instead of the **classic** way that consists of sending a whole new search query with the corrected query returned by the SAPI. In short: We now can correct with 1 request instead of 2. 2- Also added unit tests in headless to support this in the insight usecase ## DEMO INSIGHT (queryCorrectionMode: 'next'): https://github.com/user-attachments/assets/12db730b-fff6-4a80-a080-db7aaa07eda2 ## DEMO INSIGHT (queryCorrectionMode: 'legacy'): https://github.com/user-attachments/assets/6fa25da6-d081-4611-b713-4eedd6302e49 ## DEMO SEARCH (queryCorrectionMode: 'next'): https://github.com/user-attachments/assets/52f29cae-a3b6-44c2-b4df-22cc8df692ab ## DEMO SEARCH (queryCorrectionMode: 'legacy'): https://github.com/user-attachments/assets/595acfbd-afc4-4f38-bdb4-5193511c0564 ## TESTS: <img width="793" alt="image" src="https://github.com/user-attachments/assets/5220fc3e-58ff-43e7-b87c-38eb0643db02"> [SFINT-5680]: https://coveord.atlassian.net/browse/SFINT-5680?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
- Loading branch information
1 parent
8344a9f
commit fbd4835
Showing
9 changed files
with
447 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.