[ 
https://issues.apache.org/jira/browse/SOLR-16678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17725945#comment-17725945
 ] 

Alex Deparvu commented on SOLR-16678:
-------------------------------------

this is not a bug. please check the updated v2 syntax for how to correctly call 
this api.

I added a testcase for this, to serve as test and example. 
[https://github.com/apache/solr/pull/1663] [~gerlowskija] would you mind taking 
a look to validate?

> Collection API v2 CREATE does not handle user-defined properties
> ----------------------------------------------------------------
>
>                 Key: SOLR-16678
>                 URL: https://issues.apache.org/jira/browse/SOLR-16678
>             Project: Solr
>          Issue Type: Bug
>          Components: v2 API
>    Affects Versions: 9.1
>            Reporter: Julien Massiera
>            Priority: Major
>
> According to this documentation 
> [https://solr.apache.org/guide/solr/latest/configuration-guide/property-substitution.html],
>  we should be able with the Collection API v2 CREATE, to define custom core 
> properties and use them in the solrconfig.xml file
> This is not working properly as, for example, if I try to define a "lib.path" 
> property that I use in the solrconfig.xml of my collection, I get the 
> following error:
> {code:java}
> curl -XPOST http://localhost:8983/api/collections -H 'Content-Type: 
> application/json' -d '{"create": {"name": "MyCollection", "config": "Init", 
> "numShards": 2, "replicationFactor":1, "property.lib.path":"/my/lib/path"}}' 
> {
>   "responseHeader":{
>     "status":400,
>     "QTime":738},
>   "failure":{
>     
> "127.0.0.1:8983_solr":"org.apache.solr.client.solrj.impl.BaseHttpSolrClient$RemoteSolrException:Error
>  from server at null: Error CREATEing SolrCore 
> 'MyCollection_shard1_replica_n3': Unable to create core 
> [MyCollection_shard1_replica_n3] Caused by: No system property or default 
> value specified for lib.path value:${lib.path}/Custom",
>     
> "127.0.0.1:8983_solr":"org.apache.solr.client.solrj.impl.BaseHttpSolrClient$RemoteSolrException:Error
>  from server at null: Error CREATEing SolrCore 
> 'MyCollection_shard2_replica_n1': Unable to create core 
> [MyCollection_shard2_replica_n1] Caused by: No system property or default 
> value specified for lib.path value:${lib.path}/Custom"},
>   "Operation create caused 
> exception:":"org.apache.solr.common.SolrException:org.apache.solr.common.SolrException:
>  Underlying core creation failed while creating collection: MyCollection",
>   "exception":{
>     "msg":"Underlying core creation failed while creating collection: 
> MyCollection",
>     "rspCode":400},
>   "error":{
>     "metadata":[
>       "error-class","org.apache.solr.common.SolrException",
>       "root-error-class","org.apache.solr.common.SolrException"],
>     "msg":"Underlying core creation failed while creating collection: 
> MyCollection",
>     "code":400}}{code}
>   
> Doing the same with the Collection API v1 properly works:
> {code:java}
> curl -XGET 
> "http://localhost:8983/solr/admin/collections?action=CREATE&name=MyCollection&collection.configName=Init&numShards=2&maxShardsPerNode=2&replicationFactor=1&property.lib.path=/my/lib/path";
> {
>   "responseHeader":{
>     "status":0,
>     "QTime":1419},
>   "success":{
>     "127.0.0.1:8983_solr":{
>       "responseHeader":{
>         "status":0,
>         "QTime":1062},
>       "core":"MyCollection_shard1_replica_n3"},
>     "127.0.0.1:8983_solr":{
>       "responseHeader":{
>         "status":0,
>         "QTime":1062},
>       "core":"MyCollection_shard2_replica_n1"}}} {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to