Hi everyone ,

solrj getBeans method does not get child documents if we provide nested_path

below is my nested path configuration.

``` <fieldType name="_nest_path_" class="solr.NestPathField"
maxCharsForDocValues="-1" omitNorms="true" omitTermFreqAndPositions="true"
stored="false"/>
<field name="_nest_path_" type="_nest_path_" /> ```
and this part skipped science there the path name did not match to a Solr
Document

public SolrDocument readSolrDocument(DataInputInputStream dis) throws
IOException {
    tagByte = dis.readByte();
    int size = readSize(dis);
    SolrDocument doc = new SolrDocument(new LinkedHashMap<>(size));
    for (int i = 0; i < size; i++) {
      String fieldName;
      Object obj = readVal(dis); // could be a field name, or a child
document
      if (obj instanceof SolrDocument) { // this part is skipped when we
provide a  *_nest_path_*
        doc.addChildDocument((SolrDocument)obj);
        continue;
      } else {
        fieldName = (String)obj;
      }
      Object fieldVal = readVal(dis);
      doc.setField(fieldName, fieldVal);
    }
    return doc;
  }

is this a bug or some thing is wrong with my config.
below is two solr search result document one with  _nest_path_   field and
one with not.
{
  "responseHeader":{
    "status":0,
    "QTime":2,
    "params":{
      "q":"{!parent which=\"isDismissedCase:*\"}",
      "fl":"*, [child]",
      "_":"1649320501066"}},
  "response":{"numFound":9,"start":0,"numFoundExact":true,"docs":[
      {
        "isDismissedCase":true,
"reportMont":1,

        "id":"000.000.002",

        "_version_":1729440921035997184,
        "childs":[
          {
            "numberOfObject":4,
            "id":"000.000.004",

            "_nest_parent_":"000.000.002",
            "_version_":1729440921035997184},

          ]},}
}

-----------------------------------
end without  _nest_path_  field.

{
  "responseHeader":{
    "status":0,
    "QTime":33,
    "params":{
      "q":"{!parent which=\"isDismissedCase:*\"}",
      "fl":"*,[child parentFilter=isDismissedCase:*]",
      "wt":"json",
      "_":"1649182832526"}},
  "response":{"numFound":9,"start":0,"numFoundExact":true,"docs":[
      {
        "isDismissedCase":true,

        "reportMont":1,

        "_version_":1729441932733579264,
        "_childDocuments_":[
        {
          "numberOfObject":4,

          "id":"000.000.004",

          "_nest_parent_":"000.000.002",
          "_version_":1729441932733579264},
  ]},}
}

------------------------------------

Reply via email to