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

Nick Shanin commented on SOLR-12849:
------------------------------------

🤖 AI text below 🤖 (posted on behalf of Nick Shanin)

I opened a PR for this: https://github.com/apache/solr/pull/5011

HttpSolrCall now resolves the collection parameter from the merged parameter 
set (URL query string plus POST form body) instead of the URL alone, so an 
alias sent as collection=<alias> in a POST body is resolved the same as in a 
GET. A regression test (AliasPostBodyTest) posts to /<alias>/select with the 
alias only in the form body and asserts the request succeeds.

> collection parameter referencing an alias being handled differently when sent 
> as GET than when sent as POST
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-12849
>                 URL: https://issues.apache.org/jira/browse/SOLR-12849
>             Project: Solr
>          Issue Type: Bug
>          Components: SolrCloud
>    Affects Versions: 7.5
>            Reporter: Shawn Heisey
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> This is a weird one.
> Fired up a cloud example, server built from branch_7x code (7.6.0-SNAPSHOT)
> Created four collections with the _default configset -- foo, foo2, bar, bar2.
> Created four aliases, here's the contents of aliases.json:
> {noformat}
>     {"collection":{
>         "b_s":"bar",
>         "b_m":"bar2,bar",
>         "f_s":"foo",
>         "f_m":"foo2,foo"}}
> {noformat}
> This curl command will fail, with "Could not find collection : b_s" as the 
> message:
> {noformat}
> curl -XPOST -s localhost:8983/solr/b_s/select -d 'q=*:*&rows=0&collection=b_s'
> {noformat}
> That seems like a bug, but it's not the whole story.  Here's where things get 
> weird.  The following two commands will NOT fail:
> {noformat}
> curl -XPOST -s localhost:8983/solr/b_m/select -d 'q=*:*&rows=0&collection=b_m'
> curl -XGET -s "localhost:8983/solr/b_s/select?q=*:*&rows=0&collection=b_s"
> {noformat}
> The first one is very similar to the one that fails, except it uses an alias 
> pointing at multiple collections instead of an alias pointing at one 
> collection.  The second is effectively identical to the command that fails, 
> except it's a GET rather than a POST -- the parameters are part of the URL 
> rather than being specified in the request body.



--
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