Search Engine PHP script using MySql Database PROJECT
Posted: Thu May 08, 2008 9:39 am
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.
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.