You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Hrishikesh Gadre <ga...@gmail.com> on 2015/02/19 02:55:13 UTC
Collections API - HTTP verbs
Hi,
Can we please document which HTTP method is supposed to be used with each
of these APIs?
https://cwiki.apache.org/confluence/display/solr/Collections+API
I am trying to invoke following API
curl http://
<hostname>:8983/solr/admin/collections?action=CLUSTERPROP&name=urlScheme&val=https
This request is failing due to following error,
2015-02-18 17:29:39,965 INFO org.apache.solr.servlet.SolrDispatchFilter:
[admin] webapp=null path=/admin/collections params={action=CLUSTERPROP}
status=400 QTime=20
org.apache.solr.core.SolrCore: org.apache.solr.common.SolrException:
Missing required parameter: name
at
org.apache.solr.common.params.RequiredSolrParams.get(RequiredSolrParams.java:49)
at
org.apache.solr.common.params.RequiredSolrParams.check(RequiredSolrParams.java:153)
at
org.apache.solr.handler.admin.CollectionsHandler.handleProp(CollectionsHandler.java:238)
at
org.apache.solr.handler.admin.CollectionsHandler.handleRequestBody(CollectionsHandler.java:200)
at
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
at
org.apache.solr.servlet.SolrDispatchFilter.handleAdminRequest(SolrDispatchFilter.java:770)
at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:271)
I am using Solr 4.10.3 version.
Thanks
Hrishikesh
Re: Collections API - HTTP verbs
Posted by Hrishikesh Gadre <ga...@gmail.com>.
Thanks Mark and Scott. Adding quotes around the URL fixed the problem.
Regards
Hrishikesh
On Thu, Feb 19, 2015 at 7:30 AM, Scott Dawson <sc...@gmail.com> wrote:
> Hrishikesh,
> If you're running on Linux or Unix, the first ampersand in the URL is
> interpreted as the shell's "run this in the background" operator and
> anything beyond the ampersand will not be passed to curl. So Mark is right
> -- put single quotes around the URL so that it's not interpreted by the
> shell.
>
> Regards,
> Scott
>
> On Wed, Feb 18, 2015 at 9:31 PM, Mark Miller <ma...@gmail.com>
> wrote:
>
> > Perhaps try quotes around the url you are providing to curl. It's not
> > complaining about the http method - Solr has historically always taken
> > simple GET's for http - for good or bad, you pretty much only post
> > documents / updates.
> >
> > It's saying the name param is required and not being found and since you
> > are trying to specify the name, I'm guessing something about the command
> is
> > not working. You might try just shoving it in a browser url bar as well.
> >
> > - Mark
> >
> > On Wed Feb 18 2015 at 8:56:26 PM Hrishikesh Gadre <ga...@gmail.com>
> > wrote:
> >
> > > Hi,
> > >
> > > Can we please document which HTTP method is supposed to be used with
> each
> > > of these APIs?
> > >
> > > https://cwiki.apache.org/confluence/display/solr/Collections+API
> > >
> > > I am trying to invoke following API
> > >
> > > curl http://
> > >
> <hostname>:8983/solr/admin/collections?action=CLUSTERPROP&name=urlScheme&
> > > val=https
> > >
> > > This request is failing due to following error,
> > >
> > > 2015-02-18 17:29:39,965 INFO
> org.apache.solr.servlet.SolrDispatchFilter:
> > > [admin] webapp=null path=/admin/collections params={action=CLUSTERPROP}
> > > status=400 QTime=20
> > >
> > > org.apache.solr.core.SolrCore: org.apache.solr.common.SolrException:
> > > Missing required parameter: name
> > >
> > > at
> > > org.apache.solr.common.params.RequiredSolrParams.get(
> > > RequiredSolrParams.java:49)
> > >
> > > at
> > > org.apache.solr.common.params.RequiredSolrParams.check(
> > > RequiredSolrParams.java:153)
> > >
> > > at
> > > org.apache.solr.handler.admin.CollectionsHandler.handleProp(
> > > CollectionsHandler.java:238)
> > >
> > > at
> > > org.apache.solr.handler.admin.CollectionsHandler.handleRequestBody(
> > > CollectionsHandler.java:200)
> > >
> > > at
> > > org.apache.solr.handler.RequestHandlerBase.handleRequest(
> > > RequestHandlerBase.java:135)
> > >
> > > at
> > > org.apache.solr.servlet.SolrDispatchFilter.handleAdminRequest(
> > > SolrDispatchFilter.java:770)
> > >
> > > at
> > > org.apache.solr.servlet.SolrDispatchFilter.doFilter(
> > > SolrDispatchFilter.java:271)
> > >
> > > I am using Solr 4.10.3 version.
> > >
> > > Thanks
> > >
> > > Hrishikesh
> > >
> >
>
Re: Collections API - HTTP verbs
Posted by Scott Dawson <sc...@gmail.com>.
Hrishikesh,
If you're running on Linux or Unix, the first ampersand in the URL is
interpreted as the shell's "run this in the background" operator and
anything beyond the ampersand will not be passed to curl. So Mark is right
-- put single quotes around the URL so that it's not interpreted by the
shell.
Regards,
Scott
On Wed, Feb 18, 2015 at 9:31 PM, Mark Miller <ma...@gmail.com> wrote:
> Perhaps try quotes around the url you are providing to curl. It's not
> complaining about the http method - Solr has historically always taken
> simple GET's for http - for good or bad, you pretty much only post
> documents / updates.
>
> It's saying the name param is required and not being found and since you
> are trying to specify the name, I'm guessing something about the command is
> not working. You might try just shoving it in a browser url bar as well.
>
> - Mark
>
> On Wed Feb 18 2015 at 8:56:26 PM Hrishikesh Gadre <ga...@gmail.com>
> wrote:
>
> > Hi,
> >
> > Can we please document which HTTP method is supposed to be used with each
> > of these APIs?
> >
> > https://cwiki.apache.org/confluence/display/solr/Collections+API
> >
> > I am trying to invoke following API
> >
> > curl http://
> > <hostname>:8983/solr/admin/collections?action=CLUSTERPROP&name=urlScheme&
> > val=https
> >
> > This request is failing due to following error,
> >
> > 2015-02-18 17:29:39,965 INFO org.apache.solr.servlet.SolrDispatchFilter:
> > [admin] webapp=null path=/admin/collections params={action=CLUSTERPROP}
> > status=400 QTime=20
> >
> > org.apache.solr.core.SolrCore: org.apache.solr.common.SolrException:
> > Missing required parameter: name
> >
> > at
> > org.apache.solr.common.params.RequiredSolrParams.get(
> > RequiredSolrParams.java:49)
> >
> > at
> > org.apache.solr.common.params.RequiredSolrParams.check(
> > RequiredSolrParams.java:153)
> >
> > at
> > org.apache.solr.handler.admin.CollectionsHandler.handleProp(
> > CollectionsHandler.java:238)
> >
> > at
> > org.apache.solr.handler.admin.CollectionsHandler.handleRequestBody(
> > CollectionsHandler.java:200)
> >
> > at
> > org.apache.solr.handler.RequestHandlerBase.handleRequest(
> > RequestHandlerBase.java:135)
> >
> > at
> > org.apache.solr.servlet.SolrDispatchFilter.handleAdminRequest(
> > SolrDispatchFilter.java:770)
> >
> > at
> > org.apache.solr.servlet.SolrDispatchFilter.doFilter(
> > SolrDispatchFilter.java:271)
> >
> > I am using Solr 4.10.3 version.
> >
> > Thanks
> >
> > Hrishikesh
> >
>
Re: Collections API - HTTP verbs
Posted by Mark Miller <ma...@gmail.com>.
Perhaps try quotes around the url you are providing to curl. It's not
complaining about the http method - Solr has historically always taken
simple GET's for http - for good or bad, you pretty much only post
documents / updates.
It's saying the name param is required and not being found and since you
are trying to specify the name, I'm guessing something about the command is
not working. You might try just shoving it in a browser url bar as well.
- Mark
On Wed Feb 18 2015 at 8:56:26 PM Hrishikesh Gadre <ga...@gmail.com>
wrote:
> Hi,
>
> Can we please document which HTTP method is supposed to be used with each
> of these APIs?
>
> https://cwiki.apache.org/confluence/display/solr/Collections+API
>
> I am trying to invoke following API
>
> curl http://
> <hostname>:8983/solr/admin/collections?action=CLUSTERPROP&name=urlScheme&
> val=https
>
> This request is failing due to following error,
>
> 2015-02-18 17:29:39,965 INFO org.apache.solr.servlet.SolrDispatchFilter:
> [admin] webapp=null path=/admin/collections params={action=CLUSTERPROP}
> status=400 QTime=20
>
> org.apache.solr.core.SolrCore: org.apache.solr.common.SolrException:
> Missing required parameter: name
>
> at
> org.apache.solr.common.params.RequiredSolrParams.get(
> RequiredSolrParams.java:49)
>
> at
> org.apache.solr.common.params.RequiredSolrParams.check(
> RequiredSolrParams.java:153)
>
> at
> org.apache.solr.handler.admin.CollectionsHandler.handleProp(
> CollectionsHandler.java:238)
>
> at
> org.apache.solr.handler.admin.CollectionsHandler.handleRequestBody(
> CollectionsHandler.java:200)
>
> at
> org.apache.solr.handler.RequestHandlerBase.handleRequest(
> RequestHandlerBase.java:135)
>
> at
> org.apache.solr.servlet.SolrDispatchFilter.handleAdminRequest(
> SolrDispatchFilter.java:770)
>
> at
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(
> SolrDispatchFilter.java:271)
>
> I am using Solr 4.10.3 version.
>
> Thanks
>
> Hrishikesh
>