[ 
https://issues.apache.org/jira/browse/SOLR-7054?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Noble Paul updated SOLR-7054:
-----------------------------
    Description: 
It would be a single handler say {{/docs}}

GET would do a query

GET /docs is equivalent to /select/q=*:*
GET /docs?q=a:b will be equivalent to /select?q=a:b
GET /docs/docId will be equivalent to /select?q=id:docId

PUT/POST /docs is equivalent to /update and the default format for json would 
be that of /update/json/docs

DELETE /docs/id will do a delete by id

DELETE /docs?q=x:val is delete by query

We can think of implementing this as a new {{RequestHandler}} without changing 
anything in Solr. Itcan be configured as follows
{code:xml}
<requestHandler name="/docs" class="RestRequestHandler">
  <str name="GET">/select</str> <!--This will just use the /select handler to 
handle http GET -->
  <str name="GET-single">/get</str> <!-- all GET requests to /docs/id will be 
handed by /get request handler . Please suggest a better name-->
  <str name="POST">/update/json/docs</str> <!-- All POST requests will use the 
handler configured at /update/json/docs -->
  <str name="put">/update/json/docs"</str> <!-- PUT requests will use same as 
POST -->
  <str name="delete">/update"</str> <!-- DELETE requests will use /update as 
well --> 
{code}
  
  



  was:
It would be a single handler say {{/docs}}

GET would do a query

GET /docs is equivalent to /select/q=*:*
GET /docs?q=a:b will be equivalent to /select?q=a:b
GET /docs/docId will be equivalent to /select?q=id:docId

PUT/POST /docs is equivalent to /update and the default format for json would 
be that of /update/json/docs

DELETE /docs/id will do a delete by id

DELETE /docs?q=x:val is delete by query

We can think of implementing this as a new {{RequestHandler}} without changing 
anything in Solr. Itcan be configured as follows
{code:xml}
<requestHandler name="/docs" class="RestRequestHandler" 
  get="/select" <!--This will just use the /select handler to handle http GET 
-->
  get-single= "/get" <!-- all GET requests to /docs/id will be handed by /get 
request handler . Please suggest a better name-->
  post="/update/json/docs" <!-- All POST requests will use the handler 
configured at /update/json/docs -->
  put="/update/json/docs" <!-- PUT requests will use same as POST -->
  delete="/update"/> <!-- DELETE requests will use /update as well --> 
{code}
  
  




> a pure REST interface for all operations in Solr
> ------------------------------------------------
>
>                 Key: SOLR-7054
>                 URL: https://issues.apache.org/jira/browse/SOLR-7054
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Noble Paul
>
> It would be a single handler say {{/docs}}
> GET would do a query
> GET /docs is equivalent to /select/q=*:*
> GET /docs?q=a:b will be equivalent to /select?q=a:b
> GET /docs/docId will be equivalent to /select?q=id:docId
> PUT/POST /docs is equivalent to /update and the default format for json would 
> be that of /update/json/docs
> DELETE /docs/id will do a delete by id
> DELETE /docs?q=x:val is delete by query
> We can think of implementing this as a new {{RequestHandler}} without 
> changing anything in Solr. Itcan be configured as follows
> {code:xml}
> <requestHandler name="/docs" class="RestRequestHandler">
>   <str name="GET">/select</str> <!--This will just use the /select handler to 
> handle http GET -->
>   <str name="GET-single">/get</str> <!-- all GET requests to /docs/id will be 
> handed by /get request handler . Please suggest a better name-->
>   <str name="POST">/update/json/docs</str> <!-- All POST requests will use 
> the handler configured at /update/json/docs -->
>   <str name="put">/update/json/docs"</str> <!-- PUT requests will use same as 
> POST -->
>   <str name="delete">/update"</str> <!-- DELETE requests will use /update as 
> well --> 
> {code}
>   
>   



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to