I have tried to look at Boosting and "Function Score Query", but either not understood how to use them for my purpose, or not found what technique to use in order to achieve my goal.
TL;DR The users informs me how his preferences in regards to different fields/aspects of my products, and I would like elastic search to return to me the products that BEST match his preferences. Is this possible?
I have a class with a lot of fields given as numbers. e.g.:
public class Product
{
public double? Weight { get; set; }
public int? Price { get; set; }
public double? Size { get; set; }
}
A search will be based on a (at runtime decided) series of prioritizations/scores. e.g.
Weight: 0 negative
Price: 5 negative
Size: 8 positive
These score (being normalized between 0 and 10) means that this user doesn't care about the weight of the product, he cares somewhat about the price, and he wants it negatively correlated with the value of the field (e.g. he wants price to be low, but "only" with an importance of 5 out of 10. The most important thing for this user is the size, which is quite important to be "large".
For this example I want to make a search between all of my products, but giving a higher score to products with a large size, and making the price lower being "medium" important, and not caring about the weight.
How might such a query look like?
P.S. Any links to documentation/guides for NEST/elastic search would be appreciated. I haven't found the official documentation that helpful.
EDIT: Let me rephrase: A user informs me how how important different aspects of my products are. e.g. the price, weight and size. To some users a low weight is VERY important (i.e. they score the important of a LOW weight = 10), to others the price is very important, and to some the weight is important. To some none of these are important, and to some some fields on my product is important.
After the user has scored the importance of each aspects of my product, I need to search for a product that best matches the users preferences.
As such if the user thinks the weight and price is the most important, I want elastic products that have a very low weight and price, without caring about the size.
Example: In elastic I have 4 products: (Weight = W, Size = S, Price = P)
P1: W=200, S=40, P=2500
P2: W=50, S=10, P=2000
P3: W=400, S=45, P=4000
P4: W=200, S=45, P=3000
Low weight/Price = good, High Size = good
If a user scores:
Weight=10, Price=0, Size=5
The result should be that it returns top X results, sorted (using the score system in elastic search?) as follow: P2,P4,P1,P3 (because a low price is the most important, followed by big size, with the price being irrelevant)
If a user scores:
Weight=5, Price=3, Size=8
The result should be that it returns top X results, sorted as follow: P4,P3,P1,P2 (because a high/big size is the most important, followed by low weight, with the price being of less importance)