lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Miller (JIRA)" <>
Subject [jira] Updated: (SOLR-1945) Allow @Field annotations in nested classes using DocumentObjectBinder
Date Fri, 11 Jun 2010 16:51:15 GMT


Mark Miller updated SOLR-1945:

    Attachment: SOLR-1945.patch

Started playing around with this on the plane yesterday - here is a pretty rough first draft.

You annotate members that should be drilled into with @FieldObject (need to think of the right
name here)


  public static class ItemHolder {
    String superfield;
    Item item;
    Item2 item2;

    public Item getItem() {
      return item;

    public void setItem(Item item) {
      this.item = item;
  public static class Item {
    String id;

    String[] categories;

    List<String> features;

    Date timestamp;

    int mwyMileage;

    boolean inStock = false;

    Map<String, List<String>> supplier;
    Map<String, String> supplier_simple;

    private String[] allSuppliers;

    public void setAllSuppliers(String[] allSuppliers){
      this.allSuppliers = allSuppliers;  

    public String[] getAllSuppliers(){
      return this.allSuppliers;

    public void setInStock(Boolean b) {
      inStock = b;
    // required if you want to fill SolrDocuments with the same annotaion...
    public boolean isInStock()
      return inStock;
  public static class Item2 {
    String sensai;
    Item3 item3;
  public static class Item3 {
    String server;

    String[] types;

> Allow @Field annotations in nested classes using DocumentObjectBinder
> ---------------------------------------------------------------------
>                 Key: SOLR-1945
>                 URL:
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Mark Miller
>            Assignee: Mark Miller
>            Priority: Minor
>             Fix For: Next
>         Attachments: SOLR-1945.patch
> see
> Would be nice to be able to pass an object graph to solrj with @field annotations rather
than just a top level class

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message