Everything About search_query Table In Magento 2

Everything About search_query Table In Magento 2 4

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.

1_Dashboard - search_query Table In Magento 2

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:

Everything About search_query Table In Magento 2 5

3_add new search term_search_query Table in Magento 2

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.

Get E-commers Updates in Your Inbox

Thank you for subscribing.

Something went wrong.

(based on 11 Reviews)

Sanjay is a co-founder at Meetanshi. He is a Certified Magento Developer who loves creating Magento E-commerce solutions. Owing to his contributions in Magento Forums and posting solutions, he is among the top 50 contributors of the Magento community in 2019. When he is not engrossed with anything related to Magento, he loves to play cricket.

Leave a reply:

Your email address will not be published.