Using the views module with search_api and the "Fulltext search" filter exposed, users can submit a blank search and all the results appear.
Can that behavior be avoided? Say the user must type at least 3 characters to search.

Thanks.

Comments

drunken monkey’s picture

You can just set the filter to "Required". This won't show any results unless a value is entered. However, there is no way I'm aware of to require a minimum number of characters (without altering the form with custom code).

felipe’s picture

Status: Active » Closed (works as designed)

Actually it wasn't working because of an older version of views. Updating to latest dev solved my problem.
Maybe related to this: #1054272: String filters are non optional anymore.

Thanks!