0

I use a webservice that returns a number of short (<100 characters) textstrings. I need to sort these strings in some sort of textual relevance, eg better hits should be first and hits of less quality (matching the searchterm in the last position, or inside a another word for example) later. I am guessing that this have been done a lot of times in many systems, but my googling-skills fails me.

If possible I'd like a library that I could import to my asp.net site, but I could also implement an algorithm if an existing implementation doesn't exist for .Net. Most databases have this functionallity but I don't want to put the result in a database and then ask it to sort the result for me :-)

  • How are these text strings produced? You could use LINQ / Regex for some simple stuff. Hash for intersections. – paparazzo Oct 09 '12 at 13:32
  • @Blam I get the strings from a webservice, usually somewhere between 10 to 1000 strings depending on what we send to the webservice. So I basically get an List and need to sort them by relevance, rather than by alfanumreic rules, before showing them to the user. – user1153744 Oct 09 '12 at 14:04
  • @L.B, I'm not sure how that helps me? Is there libraries that I should get from there? – user1153744 Oct 09 '12 at 14:04
  • Can't answer the question until you define the rules for relevance. – paparazzo Oct 09 '12 at 14:16
  • @Blam For the most simple cases I could implement a comparer that simply looks at the positon of the searchterm in the hit and sort by that number. To complicate one could assing a higher weight if the searchterm exists twice. I could probably go on for a while with other demands but those two are the most basic requirements. – user1153744 Oct 11 '12 at 06:13
  • Update the question with a definition of relevance and some sample data. – paparazzo Oct 11 '12 at 13:01

0 Answers0