Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Subscribe to HRA Now!

 



Are you a Google Analytics enthusiast?

Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE! 

 



 

 www.CustomReportSharing.com 

From the folks who brought you High Rankings!


Sponsored Content

 

 
 

Photo
- - - - -

Searchable Content (website)


  • Please log in to reply
4 replies to this topic

#1 interval

interval

    HR 3

  • Active Members
  • PipPipPip
  • 56 posts

Posted 11 November 2007 - 01:53 AM

Hi,

I used php to build my latest website, but I must confess I am just a php beginner using a book all the time.
My site is working well, I update it regularly and I can see that I gathered a lot of info. This moment visitors can access every info by reading a list line by line. This is a boring process and too much time consuming when there are lot of info.

I think is a good idea to make this database (let's say it database) searchable. I made a search to find codes and help. I found many sources but not of them giving a full explanation as a beginner needs. I do not want to use Google feature, unless it is the best and easiest way to do.

Please give me a help hand in simple words. If I'll understand, be sure a lot of people will do.

Advanced thanks
Interval

#2 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 11 November 2007 - 09:36 AM

The problem is there isn't a single Best Script or even a Best Method for implementing a site search capability, Interval. Instead there are many options and choosing the best usually comes down to the needs of your own site and how much time you're prepared to put into the project. For instance, just for building your own app you can you use something that simply searches your current database and returns results. And do you need word stemming or will exact matches do?

(As a caveat, MySQL has a slightly different notion of what a word is than most of we mere humans.)

MySQL has some pretty cool capabilities --the most important for site search applications being Full-Text Search. You can even have MySQL provide a relevance score for your search results to make sure things get ordered correctly.

If you need stemming, there's a little algroithm that has been out there forever (since 1979 I think) called Porter Stemmer. It's been converted to a php class. The one I use personally was ported by Richard Heyes. I believe it's only for PHP 5 now, but if you need one for PHP 4 implementations there's another similar class out there by Jon Abernathy. You should be able to find both with a quick search. And yes, both are GPL'd.

I guess the first quesiton is whether you want some sort of search app someone else has already produced, or if you want to build one yourself from the ground up. The main differences being that if you use something already produced you're likely going to be pretty limited in what you can and cannot change. While if you build it yourself you're going to spend more time on it and may have to do a good bit of reading up on several subjects. (eg the default minimum word length in MySQL is 4 characters, though this is quite easy to change in the /etc/my.cnf file if you have root access on your server.)

So one will be much easier to get up and running. The other you'll learn a lot more and have a lot more flexibility to build something that meets your exact needs. It's really not that hard to build a site search application --I've had it on my List to blog about it for awhile now, but never seem to find the time-- but by the same token it's not a 30 minutes and done sort of thing that will work best for every possible application. I don't want to scare you off from creating your own if that's what you want to do.

For the one we might be able to make some suggestions of already produced site search engines. If you're looking to build something there's not going to be an easy way to lay it out in simple words in a single forum post, as you requested. However we can probably give you some good places to read about the basics to get your started.

Which would you prefer?

#3 interval

interval

    HR 3

  • Active Members
  • PipPipPip
  • 56 posts

Posted 11 November 2007 - 11:03 AM

Thanks Randy for your explanation.

Taking into consideration my php skills and experience, I think that the best way is to use already produced site search engines. I am sure they cover my needs, at least as much as I know about this item. According to general server information, I have 4.4.4 PHP version and 4.1.22-standard MySQL.

I am nor affraid nor scared to build my own one. When I was young, I made very complicate applications. But now, when I am almost 60 years old and PHP is something very new for me, I just think that using other's experience is the best way to solve a problem for the first time.

Again many thanks.
Interval

#4 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 11 November 2007 - 07:28 PM

Rather than go through a list of php-based site search scripts and give you my opinion, here's a link to O'Rielly Publishing's ONLamp site that covers many of the most well known. With their opinion as to strengths and weaknesses. wink1.gif

#5 interval

interval

    HR 3

  • Active Members
  • PipPipPip
  • 56 posts

Posted 12 November 2007 - 02:08 AM

Many thanks

I think Sphinx fits better to my skills, needs and budget.

Interval




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users