I need Experts help on PHP Search Engine

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
PHPPRO
Forum Newbie
Posts: 2
Joined: Fri Jan 02, 2009 1:32 pm

I need Experts help on PHP Search Engine

Post by PHPPRO »

Ok i have a search engine already implemented on my site. But i made it crap.

I need a search engine that will index my site and store its date in my sql database. Then i need the search engine when a visitor search the search result have to show 20 results per page. I need the index to store titles of pages etc.

Thank you. If anyone could create it i would be gratefull for it.
PHPPRO
Forum Newbie
Posts: 2
Joined: Fri Jan 02, 2009 1:32 pm

Re: I need Experts help on PHP Search Engine

Post by PHPPRO »

my current search engine is here

http://www.gametok.com/testsearchengine/index.php

search game
User avatar
Syntac
Forum Contributor
Posts: 327
Joined: Sun Sep 14, 2008 7:59 pm

Re: I need Experts help on PHP Search Engine

Post by Syntac »

PHPPRO wrote:If anyone could create it i would be gratefull for it.
I'm afraid that's not how it works around here. We'll be happy to assist you, but you have to write it.
User avatar
omniuni
Forum Regular
Posts: 738
Joined: Tue Jul 15, 2008 10:50 pm
Location: Carolina, USA

Re: I need Experts help on PHP Search Engine

Post by omniuni »

Indeed!

I recommend that you start by making sure that your website stores any data you want to search in a database. Then, for searching, you should be able to query the database for entries that contain the search string.

Any more experienced dev's have some better feedback?
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: I need Experts help on PHP Search Engine

Post by Eran »

I assume you are storing your content in a database? if not, you should. Use the database in conjunction with a good indexing engine such as sphinx or lucene (for PHP / MySQL, Sphinx is the clear winner). Now you just need to learn some PHP and database design...
User avatar
omniuni
Forum Regular
Posts: 738
Joined: Tue Jul 15, 2008 10:50 pm
Location: Carolina, USA

Re: I need Experts help on PHP Search Engine

Post by omniuni »

Pytrin, are there any indexing engines that can work without needing to be compiled? I'm on a shared server right now, and I don't have direct access to the machine. I would love to add search capability to my website, though. At one point, I had found something that had an admin panel where you could log in and have it spider the page.

Any ideas?
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: I need Experts help on PHP Search Engine

Post by Eran »

The lucene implementation I linked to is in pure PHP (Zend Framework component). It won't be as fast as an embeded solution, but better than MySQL for text search. On the plus side, the index it creates is compatible with the Java version of lucene, so if comes a time you need more performance you can take that index and bridge it with a java implementation.
User avatar
omniuni
Forum Regular
Posts: 738
Joined: Tue Jul 15, 2008 10:50 pm
Location: Carolina, USA

Re: I need Experts help on PHP Search Engine

Post by omniuni »

Thanks! That's quite cool.
Post Reply