Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.7, 6.0
    • Component/s: clients - java
    • Labels:
      None

      Description

      If you want the raw response string out of SolrJ, the advice seems to be to just use an HttpClient directly.

      However, sometimes you may have a lot of SolrJ infrastructure already in place to build out queries, etc, so it would be much simpler to just use SolrJ to do the work.

      This patch offers a NoOpResponseParser, which simply puts the entire response into an entry in a NamedList.

      Because the response isn't parsed into a QueryResponse, usage is slightly different:

      HttpSolrServer server = new HttpSolrServer("http://localhost:8983/solr");
      SolrQuery query = new SolrQuery(":");
      QueryRequest req = new QueryRequest(query);
      server.setParser(new NoOpResponseParser());
      NamedList<Object> resp = server.request(req);
      String responseString = resp.get("response");

      1. PATCH-5530.txt
        2 kB
        Upayavira
      2. SOLR-5530.patch
        8 kB
        Shalin Shekhar Mangar
      3. SOLR-5530.patch
        10 kB
        Vitaliy Zhovtyuk

        Activity

        Hide
        Vitaliy Zhovtyuk added a comment -

        Added comments to org.apache.solr.client.solrj.impl.NoOpResponseParser
        Added Tests checking NoOpResponseParser
        Added test demonstrating how to use NoOpResponseParser in order to construct query

        Show
        Vitaliy Zhovtyuk added a comment - Added comments to org.apache.solr.client.solrj.impl.NoOpResponseParser Added Tests checking NoOpResponseParser Added test demonstrating how to use NoOpResponseParser in order to construct query
        Hide
        Shalin Shekhar Mangar added a comment -

        Thanks Vitaliy!

        The only change in this patch is that I have combined both the tests into a single test class called NoOpResponseParserTest.

        Show
        Shalin Shekhar Mangar added a comment - Thanks Vitaliy! The only change in this patch is that I have combined both the tests into a single test class called NoOpResponseParserTest.
        Hide
        ASF subversion and git services added a comment -

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

        SOLR-5530: Added a NoOpResponseParser for SolrJ which puts the entire raw response into an entry in the NamedList

        Show
        ASF subversion and git services added a comment - Commit 1564709 from shalin@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1564709 ] SOLR-5530 : Added a NoOpResponseParser for SolrJ which puts the entire raw response into an entry in the NamedList
        Hide
        ASF subversion and git services added a comment -

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

        SOLR-5530: Added a NoOpResponseParser for SolrJ which puts the entire raw response into an entry in the NamedList

        Show
        ASF subversion and git services added a comment - Commit 1564710 from shalin@apache.org in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1564710 ] SOLR-5530 : Added a NoOpResponseParser for SolrJ which puts the entire raw response into an entry in the NamedList
        Hide
        Shalin Shekhar Mangar added a comment -

        Thanks Upayavira and Vitaliy!

        Show
        Shalin Shekhar Mangar added a comment - Thanks Upayavira and Vitaliy!
        Hide
        ASF subversion and git services added a comment -

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

        SOLR-5530: Fix forbidden-api-check failure

        Show
        ASF subversion and git services added a comment - Commit 1564712 from shalin@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1564712 ] SOLR-5530 : Fix forbidden-api-check failure
        Hide
        ASF subversion and git services added a comment -

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

        SOLR-5530: Fix forbidden-api-check failure

        Show
        ASF subversion and git services added a comment - Commit 1564713 from shalin@apache.org in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1564713 ] SOLR-5530 : Fix forbidden-api-check failure
        Hide
        ASF subversion and git services added a comment -

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

        SOLR-5530: Remove empty throws clause

        Show
        ASF subversion and git services added a comment - Commit 1564720 from shalin@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1564720 ] SOLR-5530 : Remove empty throws clause
        Hide
        ASF subversion and git services added a comment -

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

        SOLR-5530: Remove empty throws clause

        Show
        ASF subversion and git services added a comment - Commit 1564722 from shalin@apache.org in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1564722 ] SOLR-5530 : Remove empty throws clause
        Hide
        ASF subversion and git services added a comment -

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

        SOLR-5530: Don't use diamond operator on branch_4x

        Show
        ASF subversion and git services added a comment - Commit 1564802 from shalin@apache.org in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1564802 ] SOLR-5530 : Don't use diamond operator on branch_4x

          People

          • Assignee:
            Shalin Shekhar Mangar
            Reporter:
            Upayavira
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development