Hi,
I want your kind help for the php 'search engine PHP script using MySql Database' for my site. My site consists of quite a lot articles that are about philosophy, literature and some scientific issues.
Number of my visitors on average is nearly 300 people per day. I want to serve with also a complicated search engine in my site and i do not want to use google's search service with commercial advertisements.
I will try to explain the structure of my site as much modular as possible so after the final working codes are cerated bu your helps,
people other than me can also use the script with some easy modifications in the code. ( It also depends on you )
I investigated the web but I coult not find a satisfying complete solution.
All detailed helps will be thankfully appreciated since I am only a PHP rookie who can only make little modifications on ready-to-use-scripts.
Best Regards
/////////////////////////////////
Related Database Table Structure:
/////////////////////////////////
Number of tables to search within : 1
Number of colums to search the word(s) : 3
Databasename : dis_db
Table Name : dis_articles
Columns Names to search within : title, author, article
primary key column name for differentiation : id
////////////////////////////////////////////////////
Requested Search Form Structure on default home page
////////////////////////////////////////////////////
Search form should ask for
>>>[/color] Should I search for exact phrase as it's written
For example: if visitor searched 'USA Cities'; PHP script only search for 'USA cities' as a complete phrase. Script should not bring the pages that contain only 'USA' or only 'cities'
>>> Should I search for at least one of the words written
For example: if visitor searched 'USA Cities'; Script SHOULD bring the pages that contain only 'USA' or only 'cities' or also 'USA cities' both
////////////////////////////////////
Requested Search Results Page Format
////////////////////////////////////
result n
title [with id knowledge for full article page linking]
author [with id knowledge for full article page linking]
page link with the format : articles.php?id= [id knowledge is now used for full article page linking]
result n+1
title
author
page link
result n+2
...
...
...
...
//////////////////////////////
Requested PhP Script Abilities
//////////////////////////////
>> Script should has detailed extra explanations in it in order to be used in other languages/translations and modifications even for php rookies (inexperienced)
>> Able to give weights & change given weights for results ranking
>> Able to count the number of occurences of the search word(or phrase) in founded article
>> If search result is in Title or Author weight coefficient is 40; and if search result is in Article, then weight coefficient is 10
For example: Visitor searched for 'USA cities'. There is a column whose title is 'Info about USA cities'. Visitor has chosen "search for exact phrase as it's written". Article itself has 'USA cities' phrase twice in itself. So the total point of the search for this article: 40 + ( 10 * 2 ) = 60 since Title has the phrase once with coefficient 40 & article has the phrase twice with coefficient 10
>> Script should rank the results descending by total point of related result. The result which has the highest total point should be seen at the top of the result page
>> Script should exclude the common words such as and, or, the ...
>> Script should make the pagination of the result page for the determined limit for the number of results. For example if the search has resulted in 40 results and the limit per page is ten,
4 result pages should be created automatically by the script with next results & previous results links
>> Script should bring the similar words found also. For example visitor searched the term 'world'. Script should count the words like 'worlds','worldwide', 'world-wide'. These terms also shold have a coefficient of 10
>> If a term is found in only 1 article and the term occurs more than once in this article, only 1 link result should be viewed by visitor. ( I saw some working scripts are bringing lots of results but every result's full article link is same)
>> Script should have error warnings for different cases.
>> Script should make sure that visitor has written search term(s). If the visitor press submit button without any term script should give warning
>> For security reasons some word or symbols should be UNSEARCHABLE like '=', '+', '++' ... These forbidden terms should be assigned to some variables, and if visitor tries one of these, script should give a warning & should not work
>> All other abilities that are not written here but essential or good are thankfully appreciated.
Search Engine PHP script using MySql Database PROJECT
Moderator: General Moderators
-
cagri.coskun
- Forum Newbie
- Posts: 1
- Joined: Thu May 08, 2008 9:24 am
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
Re: Search Engine PHP script using MySql Database PROJECT
Hi cagri and welcome to the DevNetwork forums! 
I originally used PhpDig though unfortunately it just was no longer being developed.
With the need for a still maintained freeware self-hosted PHP/MySQL search engine I settled and still am enjoying Sphider.
It supports advanced operators (I think), crawling your/any domain name, custom user agent (always make sure you clearly state who and what you are on the internet or be prepared to be shot at with 403s), real time statistics about files being crawled, statistics on what terms have been searched for, and the ability to change the math behind how pages rank (title, meta, etc).
...but most importantly it's XHTML template system uses with no doubt in my head the absolute best flexability. It's not like other template systems (such as vBulletin) where everyone on the support forums are screaming to have you implement your site in to their templates. That's always obnoxious when you're utilizing a third party module that is trying to be the end-all solution that it just can't be.
You can check out Sphider working on my site here...
http://www.jabcreations.com/search/
Presuming you are using a browser other then Internet Explorer you can for example in Firefox right-click, view the page information, and see that the media type is application/xhtml+xml. So it's not difficult at all to implement any custom/proprietary headers or your own collection of includes to Sphider's existing templates. Have fun!
I originally used PhpDig though unfortunately it just was no longer being developed.
With the need for a still maintained freeware self-hosted PHP/MySQL search engine I settled and still am enjoying Sphider.
It supports advanced operators (I think), crawling your/any domain name, custom user agent (always make sure you clearly state who and what you are on the internet or be prepared to be shot at with 403s), real time statistics about files being crawled, statistics on what terms have been searched for, and the ability to change the math behind how pages rank (title, meta, etc).
...but most importantly it's XHTML template system uses with no doubt in my head the absolute best flexability. It's not like other template systems (such as vBulletin) where everyone on the support forums are screaming to have you implement your site in to their templates. That's always obnoxious when you're utilizing a third party module that is trying to be the end-all solution that it just can't be.
You can check out Sphider working on my site here...
http://www.jabcreations.com/search/
Presuming you are using a browser other then Internet Explorer you can for example in Firefox right-click, view the page information, and see that the media type is application/xhtml+xml. So it's not difficult at all to implement any custom/proprietary headers or your own collection of includes to Sphider's existing templates. Have fun!