3

I submitted a reqest to my solr cloud server with curl:

curl http://solrserver1:8983/solr/admin/collections?action=CREATEALIAS&name=bf&collections=collection1,collection2

It return a 400 error and said: Missing required parameter: name. But you see in the command line I really provided a name parameter.

I saw several post online talking about CREATEALIAS action, so I think it must be some mistake of myself. My solr server is version 4.6.1

Could anyone know what's the reason ?

arghtype
  • 4,376
  • 11
  • 45
  • 60
syan
  • 165
  • 1
  • 10

2 Answers2

8

Should add quotes like this:

curl "http://solrserver1:8983/solr/admin/collections?action=CREATEALIAS&name=bf&collections=collection1,collection2"

It works and return status 0

syan
  • 165
  • 1
  • 10
  • syan, thank you for the small tip. It helped me a lot. I missed the simple step and was trying to see for the complicated areas. – venBigData Apr 17 '16 at 06:30
0

Following commands worked:

$ bin/solr create_collection -c techproducts -d _default -n techproducts -shards 2 -replicationFactor 2 -V

The output shows the rest api url

$ curl http://localhost:7574/solr/admin/collections?action=CREATE&name=techproducts&numShards=2&replicationFactor=2&maxShardsPerNode=-1&collection.configName=techproducts
abasar
  • 1,659
  • 1
  • 12
  • 7