I am building a search engine. And when a user types their search into my engine, my script only really checks for words in the statement, and if they match the keywords...the result is returned. But what if iPad is searched and Apple, because is is a higher rank, is returned before the official iPad website in Apple.com. I have begun using full text search but it still is a bit edgy. Any ideas?

$query = " SELECT * FROM scan WHERE ";

 $terms = array_map('mysql_real_escape_string', $terms);
 $i = 0; 
 foreach ($terms as $each) {
if ($i++ !== 0){
    $query .= " AND "; 
}
$query .= "Match(title, description, keywords, link) Against ('%{$each}%') ";
}
Member Avatar for LastMitch

@noahsmith47

I am building a search engine.

I don't anyone can help you with that. No one will write a code for you! Just google and read tutorials about it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.