Search in variables seems to have limited functionality (only first letter) Metabase v. 0.36.3

I have a table where each line represents an event and each event has the column title. When I set up a variable.

The query is basically like this

SELECT id,title,created_at
FROM events
WHERE {{title}}

Title will only search based on the first letter of the title. For example for the following titles:

title:
Football team building January 2019
Darts team building February 2018

I can only find The first one "Football team building January 2019" by typing in F.... And the second title can only be found by typing in D....

I cannot find them both by searching for "team building"

Is this expected behaviour? Searching through the documentation I'm guessing that it is?

a search box with autocomplete suggestions

Hi @ifinnsson
Search has always been “starts with” instead of “contains”, since it is a lot more resource demanding for your database to do “contains” searches. Depending on your data size, this can completely block your database from being able to do anything else.
https://github.com/metabase/metabase/issues/11682 - upvote by clicking :+1: on the first post

You can use simple Text filter like this (depending on your database type), but it will not show an autocomplete suggestion:

WHERE table.column = CONCAT('%', {{title}}, '%')
2 Likes

Thanks for the clarification @flamber
I agree that this can eat up resources, however this behaviour is limiting to me. I’ve upvoted the github issue.