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

Hoss Man commented on SOLR-9376:
--------------------------------


Steps to reproduce...


{noformat}
$ bin/solr -e cloud -noprompt
...

$ curl -H 'Content-Type: application/json' 
'http://localhost:8983/solr/gettingstarted/update?commit=true' --data-binary 
'[{"id":"FOO_DOC","xml_value_s":"<xxxfoo/>","json_value_s":"{\"jjjfoo\":1}"},{"id":"BAR_DOC","xml_value_s":"<xxxbar/>","json_value_s":"{\"jjjbar\":1}"}]'
{"responseHeader":{"status":0,"QTime":302}}

# basic sanity check, and determine which shard each doc is in...

$ curl 'http://localhost:8983/solr/gettingstarted/query?q=*:*&fl=*,%5Bshard%5d'
{
  "responseHeader":{
    "zkConnected":true,
    "status":0,
    "QTime":16,
    "params":{
      "q":"*:*",
      "fl":"*,[shard]"}},
  "response":{"numFound":2,"start":0,"maxScore":1.0,"docs":[
      {
        "id":"BAR_DOC",
        "xml_value_s":"<xxxbar/>",
        "json_value_s":"{\"jjjbar\":1}",
        "_version_":1541668910112178176,
        
"[shard]":"http://127.0.1.1:8983/solr/gettingstarted_shard1_replica1/|http://127.0.1.1:7574/solr/gettingstarted_shard1_replica2/"},
      {
        "id":"FOO_DOC",
        "xml_value_s":"<xxxfoo/>",
        "json_value_s":"{\"jjjfoo\":1}",
        "_version_":1541668910038777856,
        
"[shard]":"http://127.0.1.1:8983/solr/gettingstarted_shard2_replica1/|http://127.0.1.1:7574/solr/gettingstarted_shard2_replica2/"}]
  }}

# attempt to use [json] transformer

$ curl 
'http://localhost:8983/solr/gettingstarted/query?q=*:*&fl=id,%5bjson+f=json_value_s%5d'
{
  "responseHeader":{
    "zkConnected":true,
    "status":0,
    "QTime":16,
    "params":{
      "q":"*:*",
      "fl":"id,[json f=json_value_s]"}},
  "response":{"numFound":2,"start":0,"maxScore":1.0,"docs":[
      {
        "id":"BAR_DOC",
        "[json]":"{\"jjjbar\":1}"},
      {
        "id":"FOO_DOC",
        "[json]":"{\"jjjfoo\":1}"}]
  }}

# attempt again doing non-distrib request to a single replica...

$ curl 
'http://127.0.1.1:8983/solr/gettingstarted_shard1_replica1/query?distrib=false&q=*:*&fl=id,%5bjson+f=json_value_s%5d'
{
  "responseHeader":{
    "zkConnected":true,
    "status":0,
    "QTime":0,
    "params":{
      "q":"*:*",
      "distrib":"false",
      "fl":"id,[json f=json_value_s]"}},
  "response":{"numFound":1,"start":0,"docs":[
      {
        "id":"BAR_DOC",
        "[json]":{"jjjbar":1}}]
  }}

# same inconsistent behavior with [xml] ...

$ curl 
'http://localhost:8983/solr/gettingstarted/query?wt=xml&q=*:*&fl=id,%5bxml+f=xml_value_s%5d'
<?xml version="1.0" encoding="UTF-8"?>
<response>

<lst name="responseHeader">
  <bool name="zkConnected">true</bool>
  <int name="status">0</int>
  <int name="QTime">14</int>
  <lst name="params">
    <str name="q">*:*</str>
    <str name="fl">id,[xml f=xml_value_s]</str>
    <str name="wt">xml</str>
  </lst>
</lst>
<result name="response" numFound="2" start="0" maxScore="1.0">
  <doc>
    <str name="id">BAR_DOC</str>
    <str name="[xml]">&lt;xxxbar/&gt;</str></doc>
  <doc>
    <str name="id">FOO_DOC</str>
    <str name="[xml]">&lt;xxxfoo/&gt;</str></doc>
</result>
</response>

$ curl 
'http://127.0.1.1:8983/solr/gettingstarted_shard1_replica1/query?wt=xml&distrib=false&q=*:*&fl=id,%5bxml+f=xml_value_s%5d'
<?xml version="1.0" encoding="UTF-8"?>
<response>

<lst name="responseHeader">
  <bool name="zkConnected">true</bool>
  <int name="status">0</int>
  <int name="QTime">0</int>
  <lst name="params">
    <str name="q">*:*</str>
    <str name="distrib">false</str>
    <str name="fl">id,[xml f=xml_value_s]</str>
    <str name="wt">xml</str>
  </lst>
</lst>
<result name="response" numFound="1" start="0">
  <doc>
    <str name="id">BAR_DOC</str><xxxbar/></doc>
</result>
</response>

{noformat}



> RawValueTransformerFactory ([json] & [xml]) don't work in SolrCloud
> -------------------------------------------------------------------
>
>                 Key: SOLR-9376
>                 URL: https://issues.apache.org/jira/browse/SOLR-9376
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Hoss Man
>
> While working on SOLR-9314, I discovered that RawValueTransformerFactory 
> (which powers the {{[xml]}} and {{[json]}} doc transformers) doesn't work 
> with distributed requests.
> This affects both regular searches, as well as RTG (committed or uncommitted)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to