Posted by colinafoley on February 10, 2012 at 2:32pm
I was wondering if there is a way to use the default, Services 3.x node resource index action to retrieve nodes through a title search.
For example, if I have a node with the title "Lazy Dog", I'd like to be able to hit http://example.com/endpoint/node?parameters['title']=Lazy and have the node return. I know my example URL won't work as is.
Are there any special characters I can add to the value of my title parameter? The effect I'm trying to achieve is MySQL's LIKE "%%%%" clause. I suspect this is not possible and that the query packaging done by services_resource_build_index_query() and services_resource_execute_index_query() will not allow for this.

Comments
Hey Colin! I'm currently
Hey Colin! I'm currently doing this same functionality, but through the services_views module (along with the services module). There also a patch for services_views that allows you to rename the XML node names to whatever the field labels are (so your XML ends up being very readable).
Being that this solution relies on views, you can expose whatever filters or contextual argument options you want to the service endpoint.
Hope that helps!
Thanks
Hey Nate,
Thanks for the tip. I hadn't even thought of looking at services_views. I don't have Views running on the site, but maybe going the services_views route will save time in the long run.
No problem. FYI, here is the
No problem. FYI, here is the thread with the patch(es) I mentioned. They make services_views much more valuable due to it's cleaner output.
http://drupal.org/node/1131194
Hey Colin - I wanted to
Hey Colin - I wanted to follow up and see how you made out with this ... ?
Any chance you'd want to plan on sharing a little of your experience at the next meet up? Between you and I, we may be able to share some experience with the rest of the group about web services with Drupal.
Let me know what you think!
Anyone else here play with services (and potentially services_views as well)?
Services at meetup
I haven't had to implement the title search yet, so I can't speak to that.
I can talk about defining/creating custom resources for Services as well as a new distribution called Drupanium (see http://groups.drupal.org/node/208083 and www.drupanium.org).
What's the setup going to be like at Bethlehem Brew Works? Last time I was at one of these at Brew Works it was a round-table environment. Any plans for presenting a little more easily?
I was originally planning on
I was originally planning on focusing just on mobile (for this very reason). However, we do have a few more people coming than last time so I'll see what I can do.
Looks like some interesting stuff - can't wait to see it!
There's no facilities for
There's no facilities for setting up a projector, so bring your mobile device :)
Ken and I were talking - it's been informally turning out this way so unless there's objection, it looks to be a good pattern to alternate social meet up and presentation meet up (tonight being more social). I'd also like to continue to encourage people to volunteer hosting a meet up in hopes of changing things up and getting more folks personally involved.
See you tonight!
I would be interested in
I would be interested in this. I haven't really used services yet but foresee it in the future with App interest building.
Have you been following any of the discussion about Drupal 8 and the Web Services and Context Core Initiative? Really looking forward to where they're going with this.
http://groups.drupal.org/wscci
Checkout Content API
We built the Content API to address this very issue: querying content via an api. Here's the documentation on available filters.
The Content API is built on top of Services and provides a content resource. The module is designed entirely for data publishing, not for the full CRUD operations as provided by Service's node resource.