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.

Comments

marcingy’s picture

Assigned: Unassigned » marcingy
coupet’s picture

Great addition. What about 6.x version?

Darly

marcingy’s picture

This 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

marcingy’s picture

StatusFileSize
new1.39 KB

As 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

snelson’s picture

StatusFileSize
new3.73 KB

Rolled as a patch. Lightly tested, seems to work. None of the code was changed.

marcingy’s picture

Rob

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

marcingy’s picture

comitted drupal 5 and drupal 6

marcingy’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

carvalhar’s picture

is there a way to search with i18n? i mean...to make the search service respect current language?

thanks