I am in the process of writing a REST API spec and struggling to find the correct representation for the search functionality.
The search would typically expect 1 or 2 main (non-optional) parameters along with 10-15 optional parameters (which may or may not be filters) and hit a solr/elasticsearch implementation to get content
I have read How to design RESTful search/filtering? and http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api and tempted to expose "search" itself as a resource and do a POST with a JSON body. However it doesn't feel right (and RESTful) when a more acceptable approach is query parameters and GET
The UI this API will feed into is actually a Search website. So a typical user scenario will be user searches for something and once a list is returned, the user is able to drill down to each element/item. The item will not be a flat object. It will be a complex object with nested resources which i intend to expose by following HATEOAS.
I am not entirely sure how to proceed with this and was hoping to get some feedback/answers.
Thanks very much
EDIT
I ended up doing what is suggested here by user Qwerty RESTful URL design for search
thanks you all those who commented.