I have a views index page that when displaying results without a text search I want to display sorted alphabetically by a taxonomy reference fields name. I can get it to sort by this reference field using the Search API Sort module, but it sorts by the term ID instead of based on the term name. I've also tried to do the same using Views sorting but it doesn't work. I tried creating a relationship to the term in Views but it wouldn't let me sort by fields added via that relationship.

Is this possible to do?

  • To be able to sort by a field in search API, you need to add it to the index. – Alfred Armstrong Nov 21 '19 at 10:00
  • It is in the index... the problem is that since its a taxonomy field its sorting by the TID and not the name. – fallenturtle Nov 21 '19 at 17:25
  • Sorry, I probably wasn't clear. The taxonomy NAME has to be in the index. I can't recall offhand the exact steps to do this which is why this is a comment and not an answer. – Alfred Armstrong Nov 22 '19 at 9:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.