Hi all,
The question below was deleted for some reason I don't understand (no comment was being made). Perhaps the deleter wasn't familiar with the concept of fuzzy logic. This is okey - just think of the question as relating to ranking in SELECT statements for dealing with big data. So I try again, and have also tried to improve the question to the best of my knowledge. The question itself is very important to me, as it is fundamental to a research problem I am working on. /Petter
Hi all,
I'm working on a "fuzzy logic" way to retrieve and order (ranking/weighing) data from a database. For example, if a person looks for a hotel room in between 100 and 200 euros per night, a room that costs 150 euros might be ranked as number one, a room that costs 199 euros will be ranked rather low in the result list, and a room that costs 202 euros might still be included in the results, in case there are just a few (if any) results that fulfil the user's requirements. Another example: A customer wants to look for red shirts in the 30-50 euro price range, and the database displays darkred shirts as well, as they are a rather close match and cost 40 euros.
I'm now thinking of how to accomplish this behaviour using a SqlServer database. (NOTE: I'm not looking for the built-in freetext search features.)
One way to go ahead would probably mean using Sql functions, to which I send the values that the user enters (for example via a web site form --> stored procedure), so that I end up with a number of functions for various cases of fuzzy logic.
Another way would perhaps be to use Linq to Sql and then write the functions in C# (I might be incorrect here). I'm much better at writing C# code than advanced Sql code plus I can check the code as I test it in Visual Studio, so if this would be feasible, then that would probably be a good thing, but then again, this approach wouldn't be that independent, and I hope to implement a fuzzy logic project here at CodeProject for anyone to use.
A third option would be to do a simple rank in long, nasty-looking stored procedures, using syntax like in
http://stackoverflow.com/questions/9329678/sql-search-query-how-to-assign-weight-to-each-input-parameters-and-how-to-order[
^] However, this approach would not be easy to maintain or to use in other projects.
Perhaps there is a fourth option that I might have missed, but I have done extensive searching and reading on fuzzy logic, and these options are what I have come up with.
I also have yet to see any usable code of these options, so for the moment, I could really use any help that's out there. In other words, if someone is familiar with working with this concept, I would be happy for any pointers.
Thanks very much in advance,
Petter