I've developed an additional service to implement Drupal content searching. This service provides one method, search.searchData, which uses Drupal's hook_search (and is closely based on the Drupal API command search_data).
The service accepts up to three arguments:
1. search_keys: the keywords for the search
2. type (optional): the type of data to search (i.e. 'node', 'user')
3. simple (optional): if set, the search returns only the main fields (link, type, title, user, date, snippet) and removes any additional data
I hope this is useful to others and can be included in a future Services release.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | search_service.patch | 3.73 KB | snelson |
| #4 | search_service.tar_.gz | 1.39 KB | marcingy |
| search_service-20080207.tar_.gz | 1.48 KB | arithmetric |
Comments
Comment #1
marcingy commentedComment #2
coupet commentedGreat addition. What about 6.x version?
Darly
Comment #3
marcingy commentedThis feature will be migrated to drupal 6. There is going to be an attempt to get services into core for drupal 7. The issues assigned to me are simply items that we feel we need to work on before starting this work.
If you want to get involved in the process/discussions you can go to http://groups.drupal.org/services
Comment #4
marcingy commentedAs this is going to go into core we should split out the search into searchNode and searchUser.
If someone then requires additional search type they need to create a new service.
New version of code attached which requires review.
Otherwise it works will
Thanks
Marc
Comment #5
snelson commentedRolled as a patch. Lightly tested, seems to work. None of the code was changed.
Comment #6
marcingy commentedRob
Can you run an eye over this. I have tested it but it doesn't feel right for me to sign off as it is basically my code still.
Marc
Comment #7
marcingy commentedcomitted drupal 5 and drupal 6
Comment #8
marcingy commentedComment #9
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #10
carvalhar commentedis there a way to search with i18n? i mean...to make the search service respect current language?
thanks