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

SolrJ NoOpResponseParser

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 4.7, 6.0
    • clients - java
    • 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");

      Attachments

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

        Activity

          People

            shalin Shalin Shekhar Mangar
            upayavira Upayavira
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: