-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update SDK to allow DA on vertical search #1438
Update SDK to allow DA on vertical search #1438
Conversation
add direct answers to vertical search in sdk core data transformer layer Note: this sdk is using core version 1.3.0-alpha to get vertical search responses with direct answer J=SLAP-1389 TEST=auto and manual Update and run jest tests to see that results are formatted properly. Verify direct answer is fetched properly from answers-core with console log. Launched theme test site using local sdk bundle, performed a vertical search on people's page and can verify that direct answer is present in network response
@@ -258,8 +259,12 @@ export default class Core { | |||
const mergedResults = this.storage.get(StorageKeys.VERTICAL_RESULTS) | |||
.append(data[StorageKeys.VERTICAL_RESULTS]); | |||
this.storage.set(StorageKeys.VERTICAL_RESULTS, mergedResults); | |||
if (data[StorageKeys.DIRECT_ANSWER].answer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this instance we're guarding the setting of StorageKeys.DIRECT_ANSWER
, but below we just set it without checking data[StorageKeys.DIRECT_ANSWER].answer
. Do we need to check this value in both cases? If so, we could move that logic outside of the if(query.append)
conditional and only have it once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to check this value in both cases. The first result set from this vertical search may or may not have direct answers from live api, which is ok so I didn't place a check there. But with param query.append allowing for search result of new query to add on to the existing results, if this new search result contains a new directAnswer, then we would override it (since we expect only 1 directAnswer return). Otherwise, if this new search result doesn't have a directAnswer, then I think we should keep the previous directAnswer from current result set.
* Update SDK to allow DA on vertical search add direct answers to vertical search in sdk core data transformer layer Note: this sdk is using core version 1.3.0-alpha to get vertical search responses with direct answer J=SLAP-1389 TEST=auto and manual Update and run jest tests to see that results are formatted properly. Verify direct answer is fetched properly from answers-core with console log. Launched theme test site using local sdk bundle, performed a vertical search on people's page and can verify that direct answer is present in network response Co-authored-by: Yen Truong <ytruong@yext.com>
add direct answers to vertical search in sdk core data transformer layer
Note: this sdk is using core version 1.3.0-alpha to get vertical search responses with direct answer
J=SLAP-1389
TEST=auto and manual
Update and run jest tests to see that results are formatted properly.
Verify direct answer is fetched properly from answers-core with console log.
Launched theme test site using local sdk bundle, performed a vertical search on people's page and can verify that direct answer is present in network response