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

Solrj doesn't handle child documents when using queryAndStreamResponse

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.4
    • 7.6, 8.0
    • SolrJ
    • None

    Description

      Getting the results from a query that as child documents results in "parsing error" when using SolrClient's queryAndStreamResponse(), but not when using the regular query() method.

      The bug is caused by StreamingBinaryResponseParser's JavaBinCodec override of readSolrDocument which always returns null (the document is instead passed to the callback), but JavaBinCodec uses the method to also decode child documents.

      I have fixed this by using a simple nestedLevel variable that can be used to detect if the document being parsed is a child (and should be returned) or a parent (and should be passed to the callback).

      The fix feels kinda hacky, but it is simple. Link to a Github pull request to follow.

      Attachments

        Issue Links

          Activity

            People

              janhoy Jan Høydahl
              stiost Stian Østerhaug
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m