How do the suggestion for filters populate?

(Anika Kuesters Smith) #1

In order to populate suggestions for filters in Explore or in dashboards, Looker issues a SELECT DISTINCT query when you first start typing to select all distinct values of a specific field. As you continue typing, previous queries are cancelled before a new query is issued.

For instance:

SELECT DISTINCT items.name FROM items WHERE items.name LIKE 'j%'

would be cancelled in favor of:

SELECT DISTINCT items.name FROM items WHERE items.name LIKE 'jacke%'

A new query is only issued after 300 milliseconds pass without any new typing (so if you type a letter every 200ms, no new query will be issued).

After any of these DISTINCT queries finishes, no more queries are issued as you continue typing. Instead, Looker’s front end eliminates non-matching values without hitting the database.

1 Like

(alison1) #2

I just wanted to reference that you can override this default behavior with suggestions: and suggestable:. For more information, check out these posts:

Specify Suggested Values for Filters
Performance Considerations with Suggest Filters

Also, use of access_filter_fields: and/or sql_always_where: can affect suggestions for field values. See the post Why won’t my filter suggestions populate? for details.

0 Likes