Searching entire site

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kkonline
Forum Contributor
Posts: 251
Joined: Thu Aug 16, 2007 12:54 am

Searching entire site

Post by kkonline »

Hi there,
I have a site which will be growing everyday as users submit their data to the database. The site has 10 different tables for storing articles, quotation, comments, tags, images and many other table .

I want to have a common search for the entire website.

I cannot use union as the parameters for tables and the num of parameters differ.
Example article having title, titletext, content, moral . Then quotation having author and content. images having just title

Please help me how to search the entire site (The logic) or should something like sphider search project be an appropriate and easy way to go

I could have query and the section number (1 for articles, 2 for images, 3 for quotes etc...) passed to a search () as search (1,$query)

and inside that function i'll check the section if one then contents will be displayed fro articles
then i call search (2,$query) to display results for images and so on...

Any better ideas to organise and easy search?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Separate queries merged together using a logic you determine.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Yes, build your search form, and then build the SQL based on input from the form.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Post Reply