Skip to content

Proposing adding SEARCH method #133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

paulhill
Copy link
Contributor

We started using the SEARCH method when we found we couldn't gracefully accommodate our document store backed (reductive find) GET /users and our elastic-search backed (additive search) SEARCH /users.
It's a draft spec but seems pretty handy. We use it in anger at any rate.

We started using the SEARCH method when we found we couldn't gracefully accommodate or document store backed (reductive find) GET /users and our elastic-search backed (additive search) SEARCH /users.
It's a draft spec but seems pretty handy. We use it in anger at any rate.
@webron
Copy link
Member

webron commented Sep 29, 2014

Hi @paulhill - do you have any online references to the SEARCH method? Even the draft spec?

@paulhill
Copy link
Contributor Author

https://datatracker.ietf.org/doc/rfc5323/

We don't adhere strictly to that draft spec in that we only support a JSON body, but the basic principle is sound. It's like a simple GET request except the body is important because it contains search criteria. This allows us to cleanly separate the "GET with query params" reductive find (e.g. GET /users) from the relevance based (inverse document count) Google style additive search (e.g. SEARCH /users).
Mostly these days people will fall back to verbs in the URI to achieve this. e.g. findUsersByX or GET /users/search, but that ain't ReST, that's RPC and makes all the puppies cry.

@webron
Copy link
Member

webron commented Oct 9, 2014

@paulhill - I'm inclined to add it. I admit I wasn't aware of it, and it does sound interesting.

I'm not going to merge it just yet as I want to modify the schema to support it too (currently working on that on a fork, lots of changes there).

Since you seem to be familiar with it quite a bit - are there any technical restrictions that should be imposed on SEARCH operations? I'm not talking about design considerations but actual technical restrictions that may affect a 'legal' operation as described by the RFC.

@webron
Copy link
Member

webron commented Oct 27, 2014

@paulhill nudge ;)

@paulhill
Copy link
Contributor Author

Hi, sorry, swamped.
No restrictions really. The spirit of the RFC seems to just be that a search query can be passed in the body, but the are no restrictions about how it is structured. It's structured just like a POST really but with the added implication of no side effects, like a GET.

@webron
Copy link
Member

webron commented Oct 27, 2014

Sounds good. I'll add it soon then.

@fehguy
Copy link
Contributor

fehguy commented Mar 4, 2015

👍

@webron
Copy link
Member

webron commented Mar 5, 2015

I'm working on a new version on the 2.0_fixes branch. Would you like to resubmit your PR against that or should I just go ahead and make the modification myself?

@ePaul
Copy link
Contributor

ePaul commented Apr 19, 2016

This pull request comes too late for 2.0 (that is out for more than a year), and for 3.0 it should be a diff to the 3.0.md instead. I guess this can be closed for now, as #325 is collecting a list of methods to support?

@webron
Copy link
Member

webron commented Apr 19, 2016

Originally we considered adding it to 2.0 after release, but eventually didn't. As @ePaul mentioned, this can be closed now.

@webron webron closed this Apr 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants