I have built a search engine in PHP using the LIKE operator, now I want to build a search engine in PHP using a relevancy algorithm. I just want it to rank results by keyword occurrences. I want it to search the entire table a specify every time a search is preformed. I don't want to index the information and then search it. Could someone please show me some code for a relevency algorithm that ranks by keyword occurrence and explian in detail how it works.

    Are you talking about searching a MySQL table with keywords? MySQL has Full-Text search functions that allow you to rank returned rows by relevance automatically. For more information, see this page.

      Thanks that helped I turned my rows in my table into fulltext.

        Write a Reply...