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

Automatic binding of results to Beans (for solrj)

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.3
    • 1.3
    • clients - java
    • None

    Description

      as we are using java5 .we can use annotations to bind SolrDocument to java beans directly.

      This can make the usage of solrj a bit simpler

      The QueryResponse class in solrj can have an extra method as follows

      public <T> List<T> getResultBeans(Class<T> klass)

      and the bean can have annotations as

      class MyBean{
      @Field("id") //name is optional
      String id;

      @Field("category")
      List<String> categories
      }

      Attachments

        1. SOLR-536.patch
          6 kB
          Noble Paul
        2. SOLR-536.patch
          19 kB
          Ryan McKinley
        3. SOLR-536.patch
          13 kB
          Noble Paul
        4. SOLR-536.patch
          12 kB
          Noble Paul
        5. SOLR-DocObjBinder.patch
          2 kB
          Noble Paul

        Activity

          People

            ryantxu Ryan McKinley
            noble.paul Noble Paul
            Votes:
            3 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: