Check if title field has a string in ElementAPI I am trying to retrieve search suggestions for a search form. I sent the parameter entered by the user, but how do I do it in the criteria?
I tried this:

'criteria' =&gt; [
    'search' =&gt; 'title: *'.Craft::$app-&gt;request-&gt;getParam("key").'*'
],


but it does not return any results. What am I doing wrong?
this is my entire endpoint:

'suggests' =&gt;function(){
        return [
            'elementType' =&gt; Product::class,
            'paginate' =&gt; false,
            'pretty' =&gt; true,
            'criteria' =&gt; [
                'limit' =&gt; 15,
                'search' =&gt; 'title: *'.Craft::$app-&gt;request-&gt;getParam("key").'*'
            ],
            'transformer' =&gt; function(Product $product)  {
                return [
                    'title' =&gt; $product-&gt;title,
                    'url' =&gt; $product-&gt;url
                ];
            },
        ];
    },
I got it.

'criteria' =&gt; [ 'title' =&gt; '*'.Craft::$app-&gt;request-&gt;getParam("key").'*' ]