If I query data from the DB manually, this query will return some data, as expected:
select * from my_table where my_field ilike '%TZ9%';
whereas what Ecto will generate – won’t. Here’s a simplified version of it:
SELECT c0."id", c0."a2".... FROM "my_table" AS c0 WHERE (c0."my_field" ILIKE $1) ["TZ9"];
Why not? Aren’t they identical?
The % .... % are missing, though. But why are they? If I insert %TZ9% into a textbox on html page in my application, some data now will be returned and this will be the expected result. Which means that Ecto won’t use % .. %
I asked 2 times because you did not respond the first time. Saying your code is the exact same and it being the same is not always the case. I asked to paste it here so we can see and make sure. It should work if you pasted it the way I had it, so that is why I want to SEE for myself.
I am trying to help you out here…
If you don’t want to share, there’s not much more I can do for you.