How do I use the Element API to search via entry title? I can't seem to find this anywhere. Thanks.

Update:

'api/entry/search.json' =&gt; function() {
    return [
        'elementType' =&gt; 'Entry',
        'criteria' =&gt; [
            'search' =&gt; (craft()-&gt;request-&gt;getParam('search')) ? craft()-&gt;request-&gt;getParam('search') : '' 
        ],
        'first' =&gt; true,
        'transformer' =&gt; function(EntryModel $entry) {
            return [
                'title' =&gt; $entry-&gt;title,
                'url' =&gt; $entry-&gt;url,
            ];
        },
    ];
},


Using the url: api/entry/search.json?search=title:test did not work.



This code works, but the title needs to be exact:

'api/entry/search.json' =&gt; function() {
    return [
        'elementType' =&gt; 'Entry',
        'criteria' =&gt; [
            'title' =&gt; craft()-&gt;request-&gt;getParam('title')
        ],
        'first' =&gt; true,
        'transformer' =&gt; function(EntryModel $entry) {
            return [
                'title' =&gt; $entry-&gt;title,
                'url' =&gt; $entry-&gt;url,
            ];
        },
    ];
},


Using this url: api/entry/search.json?title=Test%20Article, works, but not api/entry/search.json?title=Test
Following is an example of using the search feature in a GET request with parameter 'search'.  

return [
    'elementType' =&gt; 'Entry',
    'criteria' =&gt; ['search' =&gt; (craft()-&gt;request-&gt;getParam('search')) ? 'title:'.craft()-&gt;request-&gt;getParam('search') : '' ],
    'paginate' =&gt; true,
    'elementsPerPage' =&gt; 10,
    'pageParam' =&gt; 'pg',
    'transformer' =&gt; new ListTransformer(),
];`


I assume you can use this instead of the custom transformer class that is being used in the above example:

'transformer' =&gt; function(EntryModel $entry) {
    return [
        'title' =&gt; $entry-&gt;title,
        'url' =&gt; $entry-&gt;url,
        'summary' =&gt; $entry-&gt;summary,
        'body' =&gt; $entry-&gt;body,
    ];
},