Everything About search_query Table In Magento 2
search_query table in Magento 2 stores the queries searched by users through the search box in the Magento 2 store.
These search queries are used to show the search suggestions for new customers based on what the previous customers have searched. Also, the popular search terms are shown on the admin panel dashboard for the admin to analyze and understand the demands and popularity of the products.
If the search_query table is cleared out, the new customers won’t be suggested any search suggestions until new entries are populated in the table again. If you are using custom search solutions you can just truncate it.
Fields in search_query Table In Magento 2:
- query_text – It stores the value of the search string. When a user performs a search using the search box in the Magento 2 store, that string is added in the query_text field in the search_query table as a new entry.
- num_results – It stores the number of string search in a store. This field is used to display “Number of results”
- popularity – It shows the popularity of specific words in your store. This field is used to display “Number of uses”
- store_id – It shows the search from a specific store.
The values from these fields of the database are displayed in the admin panel under Marketing > SEO & Search > Search Terms as shown below:
That’s all for the search_query table in Magento 2.
Please use the Comments section below if you have any doubts on the topic. I’d be happy to help.
Do share the post with the Magento community via social media.
Thank you.
Sanjay Jethva
Sanjay is the co-founder and CTO of Meetanshi with hands-on expertise with Magento since 2011. He specializes in complex development, integrations, extensions, and customizations. Sanjay is one the top 50 contributor to the Magento community and is recognized by Adobe.
His passion for Magento 2 and Shopify solutions has made him a trusted source for businesses seeking to optimize their online stores. He loves sharing technical solutions related to Magento 2 & Shopify.
Prev
How to Apply OR Conditions To Collection In Magento 2
How To Create Schema File To Create New Database Table In Magento 2.3
Next