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

DocumentList and Document QueryResponseWriter

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.3
    • 1.5, 3.1, 4.0-ALPHA
    • search
    • None
    • My MacBook Pro laptop.

    Description

      I tried to implement a custom QueryResponseWriter the other day and was amazed at the level of unmarshalling and weeding through objects that was necessary just to format the output o.a.l.Document list. As a user, I wanted to be able to implement either 2 functions:

      • process a document at a time, and format it (for speed/efficiency)
      • process all the documents at once, and format them (in case an aggregate calculation is necessary for outputting)

      So, I've decided to contribute 2 simple classes that I think are sufficiently generic and reusable. The first is o.a.s.request.DocumentResponseWriter – it handles the first bullet above. The second is o.a.s.request.DocumentListResponseWriter. Both are abstract base classes and require the user to implement either an #emitDoc function (in the case of bullet 1), or an #emitDocList function (in the case of bullet 2). Both classes provide an #emitHeader and #emitFooter function set that handles formatting and output before the Document list is processed.

      Attachments

        1. SOLR-1516.patch
          6 kB
          Noble Paul
        2. SOLR-1516.patch
          9 kB
          Noble Paul
        3. SOLR-1516.patch
          3 kB
          Noble Paul
        4. SOLR-1516.Mattmann.112409.patch.txt
          20 kB
          Chris A. Mattmann
        5. SOLR-1516.Mattmann.101809.patch.txt
          10 kB
          Chris A. Mattmann

        Activity

          People

            noble.paul Noble Paul
            chrismattmann Chris A. Mattmann
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: