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

Yue Yu commented on SOLR-17221:
-------------------------------

[~dsmiley] sure thing! here is the PR: 
[https://github.com/apache/solr/pull/3028]

I added some more unit tests to check the case sensitive solr param case

> Http2SolrClient merges case sensitive solr params
> -------------------------------------------------
>
>                 Key: SOLR-17221
>                 URL: https://issues.apache.org/jira/browse/SOLR-17221
>             Project: Solr
>          Issue Type: Bug
>          Components: SolrJ
>    Affects Versions: 9.5
>            Reporter: Yue Yu
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> In solr9.5.0/solrj9.5.0,  the multi-shard requests are sent through 
> Http2SolrClient, and this function composes the actual Jetty Request object:
> {code:java}
> private Request fillContentStream(
>       Request req,
>       Collection<ContentStream> streams,
>       ModifiableSolrParams wparams,
>       boolean isMultipart)
>       throws IOException {
>     if (isMultipart) {
>       // multipart/form-data
>       try (MultiPartRequestContent content = new MultiPartRequestContent()) {
>         Iterator<String> iter = wparams.getParameterNamesIterator();
>         while (iter.hasNext()) {
>           String key = iter.next();
>           String[] vals = wparams.getParams(key);
>           if (vals != null) {
>             for (String val : vals) {
>               content.addFieldPart(key, new StringRequestContent(val), null);
>             }
>           }
>         }
>         if (streams != null) {
>           for (ContentStream contentStream : streams) {
>             String contentType = contentStream.getContentType();
>             if (contentType == null) {
>               contentType = "multipart/form-data"; // default
>             }
>             String name = contentStream.getName();
>             if (name == null) {
>               name = "";
>             }
>             HttpFields.Mutable fields = HttpFields.build(1);
>             fields.add(HttpHeader.CONTENT_TYPE, contentType);
>             content.addFilePart(
>                 name,
>                 contentStream.getName(),
>                 new InputStreamRequestContent(contentStream.getStream()),
>                 fields);
>           }
>         }
>         req.body(content);
>       }
>     } else {
>       // application/x-www-form-urlencoded
>       Fields fields = new Fields();
>       Iterator<String> iter = wparams.getParameterNamesIterator();
>       while (iter.hasNext()) {
>         String key = iter.next();
>         String[] vals = wparams.getParams(key);
>         if (vals != null) {
>           for (String val : vals) {
>             fields.add(key, val);
>           }
>         }
>       }
>       req.body(new FormRequestContent(fields, FALLBACK_CHARSET));
>     }
>     return req;
>   } {code}
> The problem is the use of this class *Fields fields = new Fields();*  where 
> caseSensitive=false by default, this leads to case sensitive solr params 
> being merged together. For example f.case_sensitive_field.facet.limit=5 & 
> f.CASE_SENSITIVE_FIELD.facet.limit=99
> Not sure if this is intentional for some reason?



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to