Quick Search
Module: Magenx_QuickSearchGraphQl · replaces Magenx_PopularSearchGraphQl
Fills the header search dropdown before and around the results:
- Top searches: your store’s most searched phrases, shown when the box opens.
- Promotions: products, categories, brands or links you choose. General promotions show when the box is empty. Promotions with keywords show below the results when the search matches.

Top searches
Section titled “Top searches”Top searches come from Magento’s own search term log. A term shows when it is active, returns results, and has Display in Suggested Terms on (Marketing > SEO & Search > Search Terms).
A new store shows no top searches until shoppers have searched or you add terms.
Promotions
Section titled “Promotions”- Go to Marketing > SEO & Search > Quick Search Promotions and add a promotion.
- Choose the Type and its target:
- Product: a SKU.
- Category: picked from the category tree.
- Brand: picked from the
manufactureroptions. - Link: a storefront path such as
/deals, or a fullhttp(s)URL. Needs a title and an image.
- Optional: override the Title and Image. The image must be a JPG, PNG, GIF, WebP or AVIF file in the media folder, up to 5 MB.
- Enter Keywords, comma-separated, or leave them empty for a general promotion.
- Set the store view, dates and sort order.

- A keyword matches when the search contains it, or it starts with the search: “sams” already matches “samsung”.
- A promotion whose target is gone is skipped: a disabled, hidden or out-of-stock product, an inactive category, a deleted brand.
- Links to executables and installers are refused. SVG images are refused.
- Saving a promotion updates the dropdown immediately. Start and end dates need no cache flush.
User flows
Section titled “User flows”Shopper opens the search box
- The storefront sends one request for the store view.
- It receives up to N popular phrases (most popular first) and the promotion pool.
- It shows top searches and general promotions.
Shopper types
- The storefront filters the pool locally by keyword match.
- Matching and general promotions appear under the product results; no new request.
Merchandiser adds a promotion
- They choose a type and target (SKU text; category and brand from lists; link address), optional title and image, keywords, store view, dates and order.
- Saving checks the target, link and image and refreshes the store's promotion cache.
- The promotion shows from its start date to its end date (inclusive), with no further action.
Moderator curates
- On the search phrase list they approve or remove phrases for top searches.
- Changes show at once.
First install
- Phrases each store view showed at that moment are approved automatically, so the storefront does not change.
These always hold:
- With approval on, no unapproved phrase is shown.
- No promotion with a missing or unsafe target is shown.
- A promotion never shows outside its store view or dates.
- One part failing or switched off never breaks the other.
- Keyword match = typed text contains the keyword, or the keyword starts with the typed text, ignoring case.
- Dates: start ≤ today ≤ end in the store's time zone; open ends allowed.
- Pool ≤ maximum; phrases ≤ count.
- Start and end dates take effect without clearing any cache.
- A saved or deleted promotion shows on the next request.
Edge cases
Section titled “Edge cases”| Situation | What happens |
|---|---|
| Someone searches an abusive phrase 10,000 times. | Not shown while unapproved. |
| Promoted product goes out of stock. | Promotion dropped. |
Link javascript:… or //other-host. | Refused on save and dropped on read. |
| Link to an installer file. | Refused. |
| Vector image renamed as a bitmap. | Refused. |
| End date today. | Shown today. |
| Store view deleted. | Its promotions deleted. |
| 50 phrases asked, count 8. | 8 phrases. |
| New store without searches. | Empty phrases, no error. |
Who it applies to
Section titled “Who it applies to”- Every shopper; content per store view; prices for the request's customer group.
Out of scope
Section titled “Out of scope”- Search results, product-name autocomplete or ranking.
- Personalised suggestions.
- Click or impression tracking.
- Server-side keyword matching per keystroke.
- Images hosted outside the store's media.
Install
Section titled “Install”composer require magenxcommerce/module-quick-search-graph-qlbin/magento module:enable Magenx_QuickSearchGraphQlbin/magento setup:upgradebin/magento setup:di:compile # production mode onlybin/magento cache:flush- PHP
~8.4.0||~8.5.0, Magento 2.4.8.
Upgrading from Popular Search
Section titled “Upgrading from Popular Search”Settings carry over from Magenx_PopularSearchGraphQl. Both modules can run side by side. Remove the old one only after the storefront release that uses this module is live: an older storefront still asks for the old module’s fields, and Magento would reject its store config query.
bin/magento module:disable Magenx_PopularSearchGraphQlcomposer remove magenxcommerce/module-popular-search-graph-qlbin/magento setup:upgradeConfiguration
Section titled “Configuration”Stores > Configuration > Magenx > Quick Search
Popular Search Terms
| Setting | Default | Scope | Notes |
|---|---|---|---|
Enable Popular Search Termsmagenx_quick_search/ | empty | Store view | Yes/No. When disabled quickSearchSuggestions returns no popular terms and the storefront hides its "Top searches" section. |
Number of Termsmagenx_quick_search/ | empty | Store view | Text. Shown when Enable Popular Search Terms = Yes. How many terms are returned at most. Terms come from the search_query log (Marketing > SEO & Search > Search Terms); only active terms with results that are shown in suggestions are returned. |
Show Only Approved Termsmagenx_quick_search/ | empty | Store view | Yes/No. Shown when Enable Popular Search Terms = Yes. Recommended. Shoppers add and rank search terms just by searching, so without approval anyone can push a phrase into every visitor's "Top searches" by repeating it. When on, only terms approved on Marketing > SEO & Search > Search Terms (mass action "Approve for Top Searches", column "Top Searches") are returned. |
Promotions
| Setting | Default | Scope | Notes |
|---|---|---|---|
Enable Quick Search Promotionsmagenx_quick_search/ | Yes | Store view | Yes/No. When disabled quickSearchSuggestions returns no promotions and the storefront shows no sponsored items. Items are managed under Marketing > SEO & Search > Quick Search Promotions. |
Maximum Itemsmagenx_quick_search/ | 10 | Store view | Text. Shown when Enable Quick Search Promotions = Yes. How many promotions (active, in date range, in sort order) are returned at most for a store view. The storefront filters these by keyword, so this caps the whole pool, not one dropdown. |
Admin pages and permissions
Section titled “Admin pages and permissions”- Magento_Backend::marketing_seo > Quick Search Promotions
Grant these under System > Permissions > User Roles > Role Resources:
| Resource | Under | ID |
|---|---|---|
| Quick Search Promotions | Marketing > Magento_Backend::marketing_seo | Magenx_QuickSearchGraphQl::promotion |
| Quick Search Section | Stores > Settings > Configuration | Magenx_QuickSearchGraphQl::config |
GraphQL
Section titled “GraphQL”The storefront runs quickSearchSuggestions once, the first time the dropdown opens. Keyword matching happens in the browser, so typing costs no extra request. A disabled part returns an empty list, never an error.
Queries
quickSearchSuggestions(popularTermsCount: Int): QuickSearchSuggestionsEverything the storefront's quick-search dropdown shows before results: the store's popular search terms and its sponsored items, for the request's store view. Each part is computed only when selected, and each is empty when its feature is disabled.
| Argument | Type | Description |
|---|---|---|
popularTermsCount | Int | How many popular terms to return (capped at the store's configured count). Defaults to the configured count. |
Types
type QuickSearchSuggestions - Quick-search dropdown suggestions for a store view.
| Field | Type | Description |
|---|---|---|
popular_terms | [QuickSearchPopularTerm!]! | The most searched phrases (Magento's search_query log: active, with results, flagged 'Display in Suggested Terms' and, unless the store turned approval off, approved for top searches by an admin), most popular first. |
promotions | [QuickSearchPromotion!]! | Sponsored items: active, inside their date window, in sort order, capped at the store's configured maximum. Items without keywords are general (shown on open and under every search); items with keywords target searches that match them. Items whose target no longer resolves (deleted, disabled, out-of-stock or invisible product; inactive category; removed brand option; invalid link) are left out. |
type QuickSearchPopularTerm - A popular search phrase.
| Field | Type | Description |
|---|---|---|
query_text | String! | The search phrase as typed by shoppers. |
num_results | Int | How many products the phrase matched when last searched. |
popularity | Int | How many times the phrase has been searched. |
enum QuickSearchPromotionType - What a quick-search promotion points at.
| Value | Description |
|---|---|
PRODUCT | A product, given by SKU. `product` is set. |
CATEGORY | A category. `category_url_path` is set. |
BRAND | A brand: an option of the manufacturer attribute. `brand_label` is set. |
LINK | A custom link with an admin image: a storefront path or an absolute http(s) URL. `link_url` is set. |
type QuickSearchPromotion - One sponsored item in the quick-search dropdown.
| Field | Type | Description |
|---|---|---|
id | Int! | The promotion id. |
type | QuickSearchPromotionType! | What the promotion points at. |
title | String! | Display title: the admin override, else the product name, category name or brand label. Always the admin title for links. |
image_url | String | Absolute image URL: the admin override, else the category image for categories and the manufacturer option's image swatch for brands. Null when none; for products the storefront falls back to `product.image`. |
keywords | [String!]! | Lower-cased targeting keywords. Empty for general promotions. |
product | ProductInterface | The promoted product (PRODUCT only). |
category_url_path | String | The category's URL path in the request's store view (CATEGORY only). |
brand_label | String | The brand's manufacturer option label in the request's store view (BRAND only). |
link_url | String | Where the promotion links: a storefront path starting with `/`, or an absolute http(s) URL (LINK only). |
Glossary
Section titled “Glossary”| Term | Meaning |
|---|---|
| Search phrase | A logged search: text, result count, popularity, store view. |
| Popular phrase | Active phrase with results, marked for suggestions, approved when approval is on. |
| Approval | Admin flag allowing a phrase into top searches. |
| Promotion | Sponsored dropdown item: type, target, optional title and image, keywords, store view, dates, order. |
| Target | Product SKU, category, brand, or link address. |
| General promotion | Promotion without keywords; shown on opening and with every search. |
| Keyword match | The typed text contains a keyword, or a keyword starts with the typed text. |
| Pool | All live promotions for a store view, loaded once per opening. |