0

I have a json structure like this:

{
    "foo": "123",
    "bar" : {
         "baz" : ["1","2","3"],
         "faz" : "hello"
     }
}

Which I am trying to represent in Solr 6.2 and this schema fails to give me the expected result:

<field name="_root_" type="string" docValues="false" indexed="true" stored="false" />
<field name="foo" type="string" indexed="true" stored="true"/>
<field name="bar" type="string" indexed="true" stored="true"/>
<field name="bar.baz" type="strings" indexed="true" stored="true"/>
<field name="bar.faz" type="string" indexed="true" stored="true"/>

The resulting schema is this:

{
    "foo": "123",
    "bar" : "",
    "bar.baz" : ["1","2","3"],
    "bar.faz" : "hello"
}
Woot4Moo
  • 23,987
  • 16
  • 94
  • 151

1 Answers1

1

use multivalued=true for baz

dont use bar.baz. just give baz and faz change these fields

<field name="bar.baz" type="strings" indexed="true" stored="true"/>
<field name="bar.faz" type="string" indexed="true" stored="true"/>

to

<field name="baz" type="string" multiValued="true" indexed="true" stored="true"/>
<field name="faz" type="string" indexed="true" stored="true"/>
Vinod
  • 1,965
  • 1
  • 9
  • 18