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

ASF subversion and git services commented on SOLR-12108:
--------------------------------------------------------

Commit 11af2144b66717f41e2fcb5c73c7059cf009a00a in lucene-solr's branch 
refs/heads/branch_7x from Chris Hostetter
[ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=11af214 ]

SOLR-11891: DocStreamer now respects the ReturnFields when populating a 
SolrDocument
This is an optimization that reduces the number of unneccessary fields a 
ResponseWriter will see if documentCache is used

This commit also includes fixes for SOLR-12107 & SOLR-12108 -- two bugs that 
were previously dependent on the
un-optimized behavior of DocStreamer in order to function properly.

- SOLR-12107: Fixed a error in [child] transformer that could ocur if 
documentCache was not used
- SOLR-12108: Fixed the fallback behavior of [raw] and [xml] transformers when 
an incompatble 'wt' was specified,
  the field value was lost if documentCache was not used.

(cherry picked from commit 8bd7e5c9d254c1d629a784e0b601885adea2f57b)


> raw transformers ([json] and [xml]) drop the field value if wt is not a match 
> and documentCache is not enabled
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-12108
>                 URL: https://issues.apache.org/jira/browse/SOLR-12108
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Hoss Man
>            Assignee: Hoss Man
>            Priority: Major
>
> discovered this while working on SOLR-11891...
> The {{RawValueTransformerFactory}} class is suppose to treat the field value 
> as a normal string in situations where an instance is limited by the {{wt}} 
> param (which it is automatically for the default {{[json]}} and {{[xml]}} 
> transformers.
> This is currently implemented by {{RawValueTransformerFactory.create()}} 
> assuming it can just return "null" if the ResponseWriter in use doesn't match 
> - but because of how this transformer abuses the "key" to implicitly indicate 
> the field to be returned (ie: {{my_json_fieldName:[json]}}, it means that 
> nothing about the resulting {{ReturnFields}} datastructure indicates that the 
> field ({{my_json_fieldName}}) should be returned at all.
> Because of the existing sloppy code in SOLR-11891, that means this bug in 
> ChildDocumentTransformer only impacts current users if the documentCache is 
> disabled
> ----
> Example steps to reproduce w/techproducts config assuming {{solrconfig.xml}} 
> is edited to disable documentCache...
> {noformat}
> $ curl 'http://localhost:8983/solr/techproducts/update?commit=true' -H 
> 'Content-Type: application/json' --data-binary '[
>   {
>     "id": "1",
>     "raw_s":"{\"raw\":\"json\"}" } ]'
> {
>   "responseHeader":{
>     "status":0,
>     "QTime":39}}
> $ curl 'http://localhost:8983/solr/techproducts/query?wt=json&q=id:1&fl=raw_s'
> {
>   "responseHeader":{
>     "status":0,
>     "QTime":2,
>     "params":{
>       "q":"id:1",
>       "fl":"raw_s",
>       "wt":"json"}},
>   "response":{"numFound":1,"start":0,"docs":[
>       {
>         "raw_s":"{\"raw\":\"json\"}"}]
>   }}
> $ curl 
> 'http://localhost:8983/solr/techproducts/query?wt=json&q=id:1&fl=raw_s:%5Bjson%5D'
> {
>   "responseHeader":{
>     "status":0,
>     "QTime":0,
>     "params":{
>       "q":"id:1",
>       "fl":"raw_s:[json]",
>       "wt":"json"}},
>   "response":{"numFound":1,"start":0,"docs":[
>       {
>         "raw_s":{"raw":"json"}}]
>   }}
> $ curl 
> 'http://localhost:8983/solr/techproducts/query?wt=xml&q=id:1&fl=raw_s:%5Bjson%5D'
> <?xml version="1.0" encoding="UTF-8"?>
> <response>
> <lst name="responseHeader">
>   <int name="status">0</int>
>   <int name="QTime">0</int>
>   <lst name="params">
>     <str name="q">id:1</str>
>     <str name="fl">raw_s:[json]</str>
>     <str name="wt">xml</str>
>   </lst>
> </lst>
> <result name="response" numFound="1" start="0">
>   <doc></doc>
> </result>
> </response>
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to