Ticket #6850 (closed enhancement: duplicate)

Opened 4 years ago

Last modified 2 weeks ago

Suggestion: New XMLRPC API for searching posts

Reported by: redsweater Owned by: josephscott
Priority: normal Milestone:
Component: XML-RPC Version:
Severity: normal Keywords:
Cc: redsweater

Description

The limitations of the XMLRPC getRecentPosts API call are often cited as the core limiting factor for many desktop clients. In particular, the fact that only the last "N" posts can be fetched makes it difficult or impossible to provide access to very old posts, without imposing a burden on the server.

A user's request got me thinking and I realized that the API might benefit from a very generalized "search" API that would allow for a huge variety of useful operations without bloating the API namespace too much.

For instance, the search API might take an array of "search parameters", such as:

search string - true if the body, title, etc of a post contains this string post category/tag - only return posts in a given taxonomy post status - useful for retrieving a list of only draft or only published items post id - perhaps a list of post id ranges, so a client could ask for posts {10-15, 18, 21} post date - a date range e.g. only posts from january-june of 2007 post author - this would be awesome for clients to be able to restrict listings to only the particular author

If the API took a "maximum results" parameter as well, its functionality could match exactly "getRecentPosts", if no search parameters are provided.

I think an API like this could be very powerful and also take the pressure off as far as specific requests for accessors to only get draft posts, etc.

Change History

  • Cc redsweater added

I also think this idea could be extended to the APP implementation. For instance a collection listing could be narrowed down by requesting something like:

GET  http://myblog.uri/wp-app.php/posts?status=draft&author=Daniel%20Jalkut

I have pinged the atom-pub email list to see what they all think about this idea as it pertains to APP.

comment:2   matt3 years ago

  • Milestone changed from 2.7 to 2.8
  • Milestone changed from 2.8 to Future Release

comment:4   ryan2 years ago

Related #10388

  • Status changed from new to closed
  • Resolution set to duplicate
  • Milestone Future Release deleted

Closing this as a Duplicate of #18433 which has patches and traction for 3.4

Note: See TracTickets for help on using tickets.