Spotlight top hit algorithm
I'm implem开发者_StackOverflowenting a MacOS X's spotlight like universal search for a web based software. So the basic functionality (fetching results, displaying them) is done and it's working perfectly, but now I have to do some more work on giving the user the right results.
Basically I have three important parts in the software
Document ID
Document Person (to who the document is sent)
Images with names (to be attached to the document)
Persons (to who to send the documents)
So the idea is that when the user searches it gives them a list of items based on either four of these fields (documents,based on document id, document name; images based on image name; persons based on person's name).
Now it just gives a list of the items that match, but I'd like to make it more intuitive, like Spotlight. There for example if you search for "Mouse" it gives you a Top Hit named "Mouse", pointing you to the mouse settings and then list of other places related to mouse.
And now the real question is - how does Spotlight rank Mouse as the Top hit and also how does it rank documents as Top hit?
I couldn't find anything related to this (don't quite know how to formulate my search on this). Any algorithms and pointers would be greatly appreciated. Thanks!
Searching is a huge topic. You can start reading this - http://en.wikipedia.org/wiki/Information_retrieval
You question is very broad. Try to make it more specific
精彩评论