...

How do you rate a result in a search?

david7777
02-27-2003, 07:11 AM
I have a database search facility, and would like to sort the results according to how well they mach to what was searched for. How do i do this?

raf
02-27-2003, 02:07 PM
Ooooh. This is a hard one.
It’s not something you’ll gone set up with five lines of code. So if you just think of it as a nice extra feature, then leave it. Really.

Otherwise:
- you’ll need a pretty fast database with lots of indexed variables (the variables you search on must be indexed)
- you’ll need to keep a log on the performed searches, so you can optimize your database for searches that are frequently run + to have some duplicate (preprocessed) info in table you don’t use for your normal processes
- you’ll need to think up a sort of scoring algorithem. It probably will be quite specific for your db-design and db-content and application. This algorithme will determine the score. For instance, if you have a booksales-app, and your search for “King”, well, then you will probably will give more points to a record with “king” as author then one with king in the title or publisher. (Or you want the client to be able to specify wich feelds to search first and …)
If the keyword is found 10 times, is this then better (higher score) then when it is only found once (in a particular field) ? etc etc etc. You’ll have to build a pretty complicated algorithme (on a rainy week or so).
And the choices you make are important. Different search-engines use different scoring algorithems. (For instance: I think it was Yahoo who started counting the number of pages that were linked to a certain page to determine the importance of that page, instead of just counting the appearance of keywords on that page. And the results were much better.)
- Then, you need to track and log what the users do with the searchresults. If 10 users type in “King”, and they get a resultpage with 10 items, and 9 users click the same item, then this item should get a higher score in the future. Etc etc. So you’ll be looking at some sort a neural network to keep track of all this.
- And why not add some CRM (customer relation management) to the mix (cause you really don’t just wanna show a score, you wanna to point them in the best direction. No ?
- Or you could mix in some context analysis. (You know, stuff like Autonomy and so)
In short: you’ll need to do some creative db-management, run some periodical analyses to update your ‘preprocessed’ info, keep a neural net running and so on.

Or just add a fake value. Something like this

dim starttime,displayvalue

then your select statement

starttime=Timer

then displaying recordset and after each find, you add this
timefound=Timer
displayvalue = starttimer – timerfound
displayvalue= 1 – displayvalue/100
response.write(“(“ & displayvalue & “)”)
timerfound = 0

rs.MoveNext
etc

david7777
02-27-2003, 02:31 PM
Well that was DEFINATELY harder then i thought! I was hoping for an RS method or something... :rolleyes: It makes a lot of sense though. As soon as my site is completely up and running, ill add in the rating system with the things you suggested... It sounds like a nice challenge :)

Thanx for the advice!

raf
02-27-2003, 02:54 PM
Thats the spirit.
It's more fun to code then 'response.write' and the regular monkey work.
If you want to use it in a sort of CRM model, maybe check out this for ideas

http://www.codingforums.com/showthread.php?s=&threadid=11731&highlight=neural



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum