Jump to content

Need Search Engine tips - got any?


mmosel

Recommended Posts

Hi all, I hope all is well,

I'm just beginning to write my site's advanced search engine. I've checked out the full-text search engine tutorial and it's great - no problem there. I can easily grasp how to write a basic search engine. However, my needs are a bit more complex.

For example: I have a table full of products. In this table I have ids for three external tables that will need to be included in the advanced search. I have an artists table, a media type table, and two category tables.
For the artist and media table, I can simply query the tables for the id and then include the id in my search of the product table.

Where I think I need help is with my categories. You see, I have a many to many table inbetween my products and my categories table. It get's tricky with my category table itself, because I have three levels of categories.
As an example, my category table kinda looks like this:

id | cat_name | level2_id | level3_id

So, If I was only searching for a top level category, with an id of 7, I could search the many-to-many products_categories table for all products that match id 7. (I guess I would have to join the many-to-many table with the products table? Not sure about this) - However, the above results would be limited because they wouldn't include any of the sub or sub-sub category ids! So, for a thorough search of all products in a top category, I might have to search for matches of 50 or more category ids! So I need to some how be able to tie in the search through the category tables and then the search through the many-to-many table and then finally combine that with the search of the products table itself. Did I lose you yet?

Can you see how I might be a little confused here? Any tips or suggestions to point me in the right direction?

-mmosel
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.