Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-7123

/update/json/docs should have nested document support

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.1, 7.0
    • Component/s: None
    • Labels:

      Description

      It is the next logical step after SOLR-6304
      For the example document given below where the /orgs belong to a nested document,

      {
      name: 'Joe Smith',
      phone: 876876687 ,
      orgs :[ {name : Microsoft,
                city: "Seattle,
                zip: 98052},
              {name: Apple,
               city : Cupertino,
               zip :95014 }
            ]
      } 
      

      The extra mapping parameters would be

      split=/|/orgs&
      f=name:/orgs/name&
      f=city:/orgs/city&
      f=zip:/orgs/zip
      
      • The objects at /org automatically becomes a child document because /org is a child path of{{/}}
      • All fields falling under the /orgs/ will be mapped to the child document

      alternately you can just do

      split=/|/orgs&f=$FQN:/**
      

      The fully qualified name (FQN) for chiild docs begin from /org. So the output would be

      {
        "name":"Joe Smith",
        "phone":876876687,
        "_childDocuments_":[
          {
            "name":"Microsoft",
            "city":"Seattle",
            "zip":98052},
          {
            "name":"Apple",
            "city":"Cupertino",
            "zip":95014}]}
      

        Attachments

        1. SOLR-7123-test.patch
          2 kB
          Anshum Gupta
        2. SOLR-7123.patch
          6 kB
          Vitaliy Zhovtyuk
        3. SOLR-7123.patch
          16 kB
          Noble Paul
        4. NestedDocumentMapper.java
          3 kB
          Timothy Potter

          Issue Links

            Activity

              People

              • Assignee:
                noble.paul Noble Paul
                Reporter:
                noble.paul Noble Paul
              • Votes:
                2 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: