Jump to content

Full text search & SQL conditional table join


titel

Recommended Posts

Hi guys,

 

I'm trying to build an internal full text search engine for a little CMS application I'm developing.

 

The site's content is stored inside a database with the following structure:

 

Structure Table - id | type | content_id | name | description

Pages Table - id | content

News Table - id | date | content | author

 

The basic logic behind it is that the type can be either be 0 or 1 which determines if that particular piece of content is a page or a news item. After this, the content_id filed shows which page or news item belongs there.

 

I figure that in order to build the search engine I have to first select the whole structure joined to the left either with the pages table or the news one, according to that record's type, so my first question is how to achieve that?

 

And the second question, after creating the join, what are the steps to follow to create the search engine? Are you aware of any tutorials or articles on the subject?

 

Thank you in advance for your time,

titel

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.