Placing 41M products into categories.. PHP/MySQL

by Cosmit
4 replies
So my website (link in signature) has bout 41 million products. The problem is, I need to assign those products to one of the 5000 categories. What would be a way to do that?
#41m #categories #php or mysql #placing #products
  • Profile picture of the author cgimaster
    I assume each product will go into a specific category and I hard believe it will be possible to do this automatically unless you have a list that is already assigned to the categories, if you have that then an automated code can be create to perform the changes if you do not then I guess manual entry would be the way to go for precision.

    To put it simple you need something on the products table that can be used to relate it to the category in order to be able to make something automated for this, or if you previously had a reference of both.
    {{ DiscussionBoard.errors[7364544].message }}
  • Profile picture of the author oldschoolwarrior
    I guess the only way possible to do this automatically, would be if the title of the product could classify the category.

    So, if you have a product title "Wordpress Masters", you could create a script that will scan all your product titles, and match them against a definition list for categories.

    PHP Code:
    blogcatfilter = array('wordpress','blog',b2evolution);
    sql "SELECT * from `products`;";
    res mysql_query($ sql);
    data mysql_fetch_object){
    in_array($ data->title,$ blogcatfilter)){
    sql "UPDATE products SET category = 'blog' WHERE title = '$ data->title' ";

    Or something like that.
    {{ DiscussionBoard.errors[7372291].message }}
  • Profile picture of the author lepunk
    Well, this is pretty much the problem I'm facing right now with my day time job (except we have way more products in the db)

    If you have merchants associated with your products you can update most of them with the merchant's category (won't work with merchants who sell products from multiple categories)

    Besides that you can write a script which curls each product's page and look for specific keywords.

    Also if you have money you can use mechanical turk but that will cost you a lot
    {{ DiscussionBoard.errors[7374039].message }}
  • Profile picture of the author vidpes
    I was in a similar situation as of late. What I did was pretty cheap and cost effective. I hired a bunch of cheap data entry guys(yes they were pretty good and fast), paid each of them around $5-6 per hour and got this done in a month in total.

    Maybe you can go with a similar solution and get it done.
    {{ DiscussionBoard.errors[7375282].message }}

Trending Topics