Solr
  1. Solr
  2. SOLR-6501

Binary Response Writer does not return wildcard fields

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 4.10
    • Fix Version/s: 4.10.1, 5.0, 6.0
    • Component/s: None
    • Labels:
      None

      Description

      In solr 4.10.0 queries that request dynamic fields by passing in a fl=*_exact parameter do not return any fields. This appears to only be a problem when requesting wildcarded fields via SolrJ (BinaryResponseWriter). Looks like this may have been introduced via https://issues.apache.org/jira/browse/SOLR-5968

      With Solr 4.10.0 - I downloaded the binary and set up the example:

      cd example
      java -jar start.jar
      java -jar post.jar solr.xml monitor.xml

      In a browser, if I request

      http://localhost:8983/solr/collection1/select?q=*:*&wt=json&indent=true&fl=*d

      All is well with the world:

      {
      "responseHeader": {
      "status": 0,
      "QTime": 1,
      "params": {
      "fl": "*d",
      "indent": "true",
      "q": "*:*",
      "wt": "json"
      }
      },
      "response": {
      "numFound": 2,
      "start": 0,
      "docs": [
      {
      "id": "SOLR1000"
      },
      {
      "id": "3007WFP"
      }
      ]
      }
      }
      

      However if I do the same query with SolrJ (groovy script)

      @Grab(group = 'org.apache.solr', module = 'solr-solrj', version = '4.10.0')
      
      import org.apache.solr.client.solrj.SolrQuery
      import org.apache.solr.client.solrj.impl.HttpSolrServer
      
      HttpSolrServer solrServer = new HttpSolrServer("http://localhost:8983/solr/collection1")
      SolrQuery q = new SolrQuery("*:*")
      q.setFields("*d")
      println solrServer.query(q)
      

      No fields are returned:

      {responseHeader={status=0,QTime=0,params={fl=*d,q=*:*,wt=javabin,version=2}},response={numFound=2,start=0,docs=[SolrDocument{}, SolrDocument{}]}}
      
      1. SOLR-6501.patch
        5 kB
        Shalin Shekhar Mangar

        Issue Links

          Activity

          Hide
          Robert Muir added a comment -

          Sorry, this didn't make 4.10.1

          There can always be a 4.10.2

          Show
          Robert Muir added a comment - Sorry, this didn't make 4.10.1 There can always be a 4.10.2
          Hide
          Shalin Shekhar Mangar added a comment -

          Test + fix.

          I added a test in SolrExampleTests with all possible combinations of fields (field names, globs, pseudo fields, score) which is now run for both XML and Binary response writers.

          The CSV writer already has a test which tests all these types of return fields. There are no corresponding tests for JSON. I will open a separate issue for JSON.

          Show
          Shalin Shekhar Mangar added a comment - Test + fix. I added a test in SolrExampleTests with all possible combinations of fields (field names, globs, pseudo fields, score) which is now run for both XML and Binary response writers. The CSV writer already has a test which tests all these types of return fields. There are no corresponding tests for JSON. I will open a separate issue for JSON.
          Hide
          Steve Rowe added a comment -

          +1, LGTM

          Show
          Steve Rowe added a comment - +1, LGTM
          Hide
          ASF subversion and git services added a comment -

          Commit 1624370 from shalin@apache.org in branch 'dev/trunk'
          [ https://svn.apache.org/r1624370 ]

          SOLR-6501: Binary Response Writer does not return wildcard fields

          Show
          ASF subversion and git services added a comment - Commit 1624370 from shalin@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1624370 ] SOLR-6501 : Binary Response Writer does not return wildcard fields
          Hide
          ASF subversion and git services added a comment -

          Commit 1624372 from shalin@apache.org in branch 'dev/branches/branch_4x'
          [ https://svn.apache.org/r1624372 ]

          SOLR-6501: Binary Response Writer does not return wildcard fields

          Show
          ASF subversion and git services added a comment - Commit 1624372 from shalin@apache.org in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1624372 ] SOLR-6501 : Binary Response Writer does not return wildcard fields
          Hide
          ASF subversion and git services added a comment -

          Commit 1624380 from shalin@apache.org in branch 'dev/branches/lucene_solr_4_10'
          [ https://svn.apache.org/r1624380 ]

          SOLR-6501: Binary Response Writer does not return wildcard fields

          Show
          ASF subversion and git services added a comment - Commit 1624380 from shalin@apache.org in branch 'dev/branches/lucene_solr_4_10' [ https://svn.apache.org/r1624380 ] SOLR-6501 : Binary Response Writer does not return wildcard fields
          Hide
          Shalin Shekhar Mangar added a comment -

          Looks like it did make 4.10.1

          Thanks Mike, Constantin and Steve!

          Show
          Shalin Shekhar Mangar added a comment - Looks like it did make 4.10.1 Thanks Mike, Constantin and Steve!
          Hide
          Yonik Seeley added a comment -

          Looks like it did make 4.10.1

          Awesome! Thanks guys!

          Show
          Yonik Seeley added a comment - Looks like it did make 4.10.1 Awesome! Thanks guys!
          Hide
          Burke Webster added a comment -

          I just opened SOLR-6545 which I believe is somehow related to this issue. If fixes the exception reported in SOLR-6545, but there are still some cases where the correct response isn't returned.

          Show
          Burke Webster added a comment - I just opened SOLR-6545 which I believe is somehow related to this issue. If fixes the exception reported in SOLR-6545 , but there are still some cases where the correct response isn't returned.
          Hide
          Michael McCandless added a comment -

          Bulk close for Lucene/Solr 4.10.1 release

          Show
          Michael McCandless added a comment - Bulk close for Lucene/Solr 4.10.1 release

            People

            • Assignee:
              Shalin Shekhar Mangar
              Reporter:
              Mike Hugo
            • Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development