Can I implement search box in a prominent app bar, trying to follow Material Design?

I am designing an app with a custom app bar, which in the main screen is a prominent one, meaning it's wider than the usual one. I already have some custom features there, for example city filter. I am wondering, how I could implement a search box in there.

I attach 2 screens. Is it even ok to do something like this? It somehow bothers me, but at the same time I'm having hard time figuring anything else out.

I could also open the search box under the search icon, where there is city filter and the date sort. Would it be any better?

Do you have any other ideas?

enter image description here

enter image description here