MSRCH-5448: Document numeric facet StatsBucket + RangeBucket - #593
Conversation
behavior for MSRCH-5448 - Small updates to productSearch query API reference based on code validation
🔍 Linter ReportClick to expand full reportThis comment was automatically generated by the linter bot. |
Co-authored-by: Jared Hoover <98363870+jhadobe@users.noreply.github.com>
🔍 Linter ReportClick to expand full reportThis comment was automatically generated by the linter bot. |
|
|
||
| - `phrase` - The string of text to search for. This field is required but an empty string may be used if only filtering by `category` or `categoryPath`. | ||
| - `context` - (Live Search only) Query context that allows customized search results to be returned based on the customer group passed. This is used to get the view history of a SKU. | ||
| - `context` - (Live Search only) Optional query context that allows customized search results to be returned based on the customer group or shopper view history passed. If no context is provided, the request uses the Not Logged In customer group. |
There was a problem hiding this comment.
This change is AI interpretation of code comments:
input QueryContextInput {
# The customer group code. Field reserved for future use.
# Currently, passing this field will have no impact on search results, that is, the search
# results will be for "Not logged in" customer
customerGroup: String!
# User view history with timestamp
userViewHistory: [ViewHistoryInput!]
}
Need dev validation -- should this field be included in the schema? customerGroup is also marked as required field.
Clarification:
Is the context field used? Should it be included in the documentation?
customerGroup data type is String! (A value has to be supplied?)
There was a problem hiding this comment.
Reverted this change to publish the updates. Opened a ticket to follow up on correctness of context description. (MSRCH-5633)
🔍 Linter ReportClick to expand full reportThis comment was automatically generated by the linter bot. |
🔍 Linter ReportClick to expand full reportThis comment was automatically generated by the linter bot. |
Purpose of this pull request
bucketsarray is polymorphic: numeric attributes can return both aRangeBucketand aStatsBucket, and callers should useStatsBucket.min/StatsBucket.max(notRangeBucket.from/to) to get the actual min/max of the filtered result set, since the range bucket can reflect configured/slider bounds instead.Corrects the LS API reference based on validation against the actual GraphQL schema (MSRCH-5448):
context(and its nestedcustomerGroupfield) as optional rather than required, and clarifies that requests without it default to the Not Logged In customer group.StatsBucket.titlecan be an empty string.categoryPathfilter takes a single string (not an array) foreq, and corrects spacing in thefiltercode sample.MSRCH-5448
Affected pages
whatsnew
Updated the productSearch query documentation to clarify that when a numeric facet returns both a
RangeBucketand aStatsBucket, useStatsBucket.min/maxfor the true result-set bounds, sinceRangeBucket.from/tomay reflect configured slider limits instead.