I can't seem to find this anywhere. Thanks.
Update:
'api/entry/search.json' => function() {
return [
'elementType' => 'Entry',
'criteria' => [
'search' => (craft()->request->getParam('search')) ? craft()->request->getParam('search') : ''
],
'first' => true,
'transformer' => function(EntryModel $entry) {
return [
'title' => $entry->title,
'url' => $entry->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' => function() {
return [
'elementType' => 'Entry',
'criteria' => [
'title' => craft()->request->getParam('title')
],
'first' => true,
'transformer' => function(EntryModel $entry) {
return [
'title' => $entry->title,
'url' => $entry->url,
];
},
];
},
Using this url: api/entry/search.json?title=Test%20Article
, works, but not api/entry/search.json?title=Test