Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-1688

Solr query response is not well supported

    XMLWordPrintable

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.1.0.RELEASE
    • None
    • ENTERPRISE
    • None
    • STS 2.5, Win 7

    Description

      The Solr addin for a bean provides a method to execute a query against Solr. This is nice, but there is some boilerplate code that is not provided. When you execute a Solr query against a bean class, it makes sense that the result is a list of beans. Instead, you have to manually sift through the result and query the beans individually, so that you can put the results into a listing display. This code always takes the following form:

      SolrQuery sq = new SolrQuery(search.toString());
      QueryResponse qr = Blurb.search(sq);
      Vector<Blurb> bv = new Vector<Blurb>();
      for (SolrDocument sd : qr.getResults())

      { bv.add(Blurb.findBlurb((Long)sd.getFieldValue("blurb.id_l"))); }

      model.addAttribute("blurbs", qr);

      Can this functionality be added to the search method?

      Attachments

        Activity

          People

            Unassigned Unassigned
            rsax Robert Sax
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: