convert a keyword search into a faceted term search

* provided we can convert the search keyword into an authoritative facet term
* if more than one facet is matched, we'll use the first one with the highest priority configured

related to this [pull request](https://github.com/GigaOM/gigaom/pull/5114)

see https://github.com/GigaOM/legacy-pro/issues/3995
`JOINS` should always be on a new line