Reputation: 276
if the search term provided by an end user contains any of the words or phrases (but does not need to be an exact match) contained in the Decrease_Relevance_Text field, then the relevance for that specific product is decreased by the amount in the Decrease_Relevance_Points
Upvotes: 0
Views: 244
Reputation: 276
should do
custom_score :script => "_score+doc['increase_relevance_points'].value" do
boolean do
should { match :increase_relevance_text, term}
end
end
end
Upvotes: 0
Reputation: 3400
You can use the boosting
query (official docs here)
{
"boosting" : {
"negative" : {
"match" : {
"your_field" : "decrease_relevance_text"
}
},
"negative_boost" : decrease_relevance_points
}
}
I don't know how to create this specifically with tire though, maybe someone else can help you.
Upvotes: 1