Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Feb 2003
    Location
    South Africa
    Posts
    251
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do you rate a result in a search?

    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?

  • #2
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ooooh. This is a hard one.
    It痴 not something you値l 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値l need a pretty fast database with lots of indexed variables (the variables you search on must be indexed)
    - you値l 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稚 use for your normal processes
    - you値l 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 適ing, well, then you will probably will give more points to a record with 徒ing 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値l 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 適ing, 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値l 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稚 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値l need to do some creative db-management, run some periodical analyses to update your 叢reprocessed info, keep a neural net running and so on.

    Or just add a fake value. Something like this
    Code:
    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

  • #3
    Regular Coder
    Join Date
    Feb 2003
    Location
    South Africa
    Posts
    251
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well that was DEFINATELY harder then i thought! I was hoping for an RS method or something... 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!

  • #4
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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/showthre...ghlight=neural


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •