How to boost search relevance based on certain values using Search API I'm using the Search API with a database back-end.

I would like search results that are tagged Editorial to be favoured over results not tagged Editorial. So, for example, if two articles match a search query, and one is tagged Editorial, I'd like to see the Editorial one listed first.

Can this be done?

Thanks.
It would be insanely complex to do this properly, since you need to alter some very core Search API mechanics, much of which is handled by the database backend and not search api itself.

What you could do as a hack, it to


Create two fields: A and B.
Select a non existing word like ethsrtsghtpofksd
Add the word in field A when it's an editorial and in field B when it's not an editoral.
Set the searcg weight for field A to be higher than field B
Add the word to all searches before search API sends it to the DB.


Since the word is used in all searches and it always is matches (either in field A or B) it won't effect the results, but the weight they get will be different since field A will get a boost. I haven't tried this before, but it should work. But like I said it's a hack so it's not a pretty solution, but it's a clever way of avoiding to mess with the internal workings of Search API module.