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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.