View the original community article here
Last tested: Aug 21, 2020
Filter suggestions are a way to save time when typing into filters and ensure you're choosing an option that exists in the data. When you click into a filter box, a list of suggestions will appear below the field.
Where does this list of suggestions come from?
Looker will run a query against the database to get all possible options for that field. It will look something like this:
SELECT DISTINCT <field_name>
WHERE (<field_name> LIKE '%' OR <field_name> LIKE '% %')
GROUP BY 1
ORDER BY 1
If the user types some characters into the filter box, Looker will substitute the appropriate conditions into the WHERE clause to filter the results. Looker will then show the first 100 of those results.
Can I change what suggestions are populated?
Yes! Check out this docs article.
Are suggestions cached?
Yes, they are! The cache length for filter suggestions is determined by the suggest_persist_for LookML parameter, which has a default value of "6 hours".
- If the explore is cached using a datagroup with a
sql_trigger, then the filter suggestion cache will be busted along with the regular explore cache when the trigger value changes. Therefore, datagroups are recommended for simplifying suggestion caching.
max_cache_agewill not affect filter suggestions, however—
suggest_persist_forwill take precedence over it.
- The cache cannot be cleared manually from the explore page. You can manually reset the cache for the entire datagroup in the Admin - Datagroups panel, but this will bust cache for all queries persisted using that datagroup.
Why aren't my filter suggestions populating?