I've created a .net MVC application in C# that lists organisations, there are currently 6000 records in the database (SQLServer). The fields in the organisation table are:
- Title (Alcohol support group)
- ContactPerson (James Bond)
- Content (We provide support to people with alcohol problems)
- Keywords (Alcohol, Addiction, Alcoholic)
The current search is done using linq, e.g. :
iList<Organisation> orglist = myOrgs.Where(x => x.Title.Contains('abc') ||
x.ContactPerson.Contains('abc') ||
x.Details.Contains('abc') ||
x.Keywords.Contains('abc'))
.OrderBy(x => x.Title).ToList();
The results are then ordered by title. Which is not suitable.
If someone searches for 'Alcohol Support' I want the above result at the top of the list.
I would like the results to be ranked on the following:
- Full sentence matches in organisation titles.
- All search terms in organisation titles.
- Any search terms in organisation titles.
- Any search terms in organisation keywords.
- Full sentence matches in organisation content.
Looking for advice on the best way to implement this, or if anyone knows of any algorithms/libraries out there that do this already?
** Update ** Im looking at a simpler solution now, see this link:

