diff --git a/CHANGELOG.md b/CHANGELOG.md index 804f3c1b..ed1f9352 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Fixed +- Use `fullText` when `query` is empty. + ## [0.16.12] - 2022-01-04 ### Fixed diff --git a/node/clients/search.ts b/node/clients/search.ts index 5d05de50..4025a953 100644 --- a/node/clients/search.ts +++ b/node/clients/search.ts @@ -267,6 +267,7 @@ export class Search extends AppClient { private productSearchUrl = ({ query = '', + fullText = '', category = '', specificationFilters, priceRange = '', @@ -281,7 +282,7 @@ export class Search extends AppClient { completeSpecifications = true, }: SearchArgs) => { const sanitizedQuery = encodeURIComponent( - this.searchEncodeURI(decodeURIComponent(query || '').trim()) + this.searchEncodeURI(decodeURIComponent(query || fullText || '').trim()) ) if (hideUnavailableItems) { const segmentData = (this.context as CustomIOContext).segment diff --git a/node/typings/Catalog.ts b/node/typings/Catalog.ts index 61f8b9ca..34f3c9f3 100644 --- a/node/typings/Catalog.ts +++ b/node/typings/Catalog.ts @@ -26,6 +26,7 @@ interface SearchArgs extends QueryArgs { hideUnavailableItems: boolean | null simulationBehavior: 'skip' | 'default' | null completeSpecifications: boolean + fullText?: string } interface Metadata {