In my Search API view, I'd like an Exposed filter > Entity reference to be a select box, not a text field.


I have a view which I created like:

  • Views > Add new view > Show: default node index

So it uses the Search API index as a basis.

In the Search API I have ticked to index field_entity which is an Entity reference > Content_type: entity (confusing naming, I know).

I want the user to go to the views page & be able to filter the view results by field_entity (which is an exposed filter/entity reference).

The issue is the view shows the exposed filter as a text field. I have edited field_entity & checked the box Render Views filters as select list - this works fine for a normal view but not for a Search API view.


Can I somehow convert this text field to a select box?

To clarify, I cannot use custom or contributed modules on this project, so it needs to be done without using hooks, or other modules, etc.

Drupal 7, Search API Views

  • I assume Drupal 7? Have you looked at better exposed filters module? Commented Jan 20, 2017 at 6:08
  • Yes D7, sorry should have also mentioned we can't install contrib modules! Weird project I know, long story. Thanks though, will update original question.
    – 100pic
    Commented Jan 22, 2017 at 11:38
  • Oh ok sorry missed that in your OP. Can you use custom logic in Views templates? Commented Jan 23, 2017 at 5:02
  • Yes! I think we can, since we can edit the theme layer. We also have access to a few pre-installed contrib modules, such as display suite / DS extras, but we can't install new contrib modules. No better exposed filters unfortunately :(
    – 100pic
    Commented Jan 23, 2017 at 5:35
  • sorry for delayed response. you should be able to fix that field with some logic in views_pre_render would that work within your parameters? Commented Feb 3, 2017 at 17:29

1 Answer 1


Try to use TYPE => String. This work for me. enter image description here

  • Thank you for the answer. It would be better, especially for non-sighted users, if your answer could be a bit more descriptive than just including the image. It also helps to save the information if the image were to be come unavailable.
    – mradcliffe
    Commented Jul 18, 2018 at 13:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.