With using a database as the backend for a search engine, can someone explain how scoring is achieved? Ex. searching for a term, and the results are listed in order by relevance... 100%, 90%, etc...

The method that i am using at the moment is quite simple, no regular expressions even. It simply determines whether there is more than one term in the search query. if so then the query is split into an array, and each element of the array is searched throughout the db. any thoughts?... online articles would be great.

Thanks!