Question

I am trying to populate the Search Terms in my Magento site. How can I go about quickly populating the database with my terms and synonyms without having to manually add in all my terms. I have 100s of terms so doing it manually would take forever. I am using a CSV and would be interested in getting a myphpadmin solution or php / mysql solution

Was it helpful?

Solution

The query for this is as follows. The synonym_for field is optional. Furthermore, you must provide for which store you want to insert the terms. Go to System > Manage stores and hover the link of the store (right column) you want to add the terms for. The storeid can be found in the url.

insert into catalogsearch_query(query_text, synonym_for, store_id) values('<your_search_term>', '<your_synonym>', <your_store_id>);

OTHER TIPS

I ran into this problem as well. The given answer deals with adding new search terms. In my case I had plenty of search terms and needed to update many of them with the same synonym. Here is what I did: Using a query similar to this:

SELECT query_text,synonym_for FROMcatalogsearch_query WHERE query_text LIKE '%search_term%' to determine the set of search terms that you would like to update as a group.

Then use the following query to update those search terms:

`UPDATE catalogsearch_query
SET synonym_for = 'new synonym'
WHERE query_text LIKE '%search_term%'`

You will not have all the search terms for that query - updated to the new synonym. Probably a good idea to back up the table in case you make a mistake.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top