Hi Guys,
I have been writing a database search for my site, to increase the
accuracy and chance of a successful resut i have used the metaphone() and
similar_text() comparisons to find the database entries that contain the
most words closely resembling the entered search criteria (only words with
a 80%+ similarity are recorded). The value for each word over 80% is
stored in an array, then the average worked out from that array to gauge
the rows ranking in the search results.
However, each row in the database searched contains, different amounts of
words, some with many words and some with very few. This means that the
colum with the higher amount of words has a greater chance of containing
words that score higher than 80% of the search criteria.
I was wondering if anybody knows a mathematical way of making this a more
even search, or any tips how i can make this more accurate. My site
already searches using fulltext, this is just a backup catering for
results with similar spellings etc.
I dont know if any of that made sense, but any input would be
appreciated.
Cheers
Will
I have been writing a database search for my site, to increase the
accuracy and chance of a successful resut i have used the metaphone() and
similar_text() comparisons to find the database entries that contain the
most words closely resembling the entered search criteria (only words with
a 80%+ similarity are recorded). The value for each word over 80% is
stored in an array, then the average worked out from that array to gauge
the rows ranking in the search results.
However, each row in the database searched contains, different amounts of
words, some with many words and some with very few. This means that the
colum with the higher amount of words has a greater chance of containing
words that score higher than 80% of the search criteria.
I was wondering if anybody knows a mathematical way of making this a more
even search, or any tips how i can make this more accurate. My site
already searches using fulltext, this is just a backup catering for
results with similar spellings etc.
I dont know if any of that made sense, but any input would be
appreciated.
Cheers
Will
Comment