Add support for synonyms in sort_query