hi,
i have documents that have the following fields:
title, gender,brand, category
i want to run an exact query and score each hit with a constant score, lets say:
title = 100,
gender = 50,
color = 200,
category = 300.
so if i search "red dress"
i would like to get as a score:
300 for red in color and dress in the title.
500 for red in color and dress in the category.
600 for red and dress in the title and dress in the category.
and so on.
the constant score is important because i need to scale it later to a score between 0-100 or 0-1
i can set up boosting per query but i cant set different boosting per different fields, only "^", but i am using constant_score query hence "^" doesn' matter.
what would be the best approach to have score like the following:
score = sum(term is in title)*100 +sum(term is in gender)*50+sum(term is in color)*200+sum(term is in category)*300
or even without sum, just bool
score = bool(term is in title)*100 +bool(term is in gender)*50+bool(term is in color)*200+bool(term is in category)*300
Regards,
Maor