Re: Turba API search()
Michael J Rubinsky <[email protected]>
| Newsgroups | gmane.comp.horde.devel |
|---|---|
| Message-ID | <20160608122501.Horde.nZ8SgqX5DeJFb0hAQzxiJQa@h4.theupstairsroom.com> |
Quoting Michael J Rubinsky <[email protected]>: > Quoting Sebastian Birnbach <[email protected]>: > >> I am working on a Block that will output certain address book information. >> I have trouble restricting the search to certain fields, namely the >> "company" field. >> >> >> [...] >> $terms = array($this->_params['search']); >> >> $options = array( >> 'count_only' => false, >> 'fields' => array('company') >> ); >> >> $res = $registry->contacts->search($terms, $options); >> [...] >> >> This returns all persons with the search string in any searchable field, be >> it "company" or "name". >> >> >> I enclose the Block lib/Block/Contacts.php for better reproducability, call >> it from any wiki page with this code: >> >> [[block horde/Contacts search=string]] >> >> >> >> Any clues anybody? > > Looks like the API method is expecting the 'fields' array to be > keyed by the source you are searching (since the search method can > also take an array of sources to search). I'll have a fix shortly. https://github.com/horde/horde/commit/7c4ec133547f6fc8c071a72c7c0762f77b053857 > > >> Kind regards >> >> Sebastian > > > > -- > mike > The Horde Project > http://www.horde.org > https://www.facebook.com/hordeproject > https://www.twitter.com/hordeproject -- mike The Horde Project http://www.horde.org https://www.facebook.com/hordeproject https://www.twitter.com/hordeproject -- dev mailing list Frequently Asked Questions: http://wiki.horde.org/FAQ To unsubscribe, mail: [email protected]
smime.p7s
(application/pkcs7-signature, 5.6 KB) - not displayed