[ 
https://issues.apache.org/jira/browse/SOLR-2844?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Smiley updated SOLR-2844:
-------------------------------

    Fix Version/s:     (was: 4.7)
                   4.8

> SolrJ: Make DocmentObjectBinder accept getter only fields (adapter pattern)
> ---------------------------------------------------------------------------
>
>                 Key: SOLR-2844
>                 URL: https://issues.apache.org/jira/browse/SOLR-2844
>             Project: Solr
>          Issue Type: Improvement
>          Components: clients - java
>            Reporter: Jens Wike
>            Priority: Minor
>             Fix For: 4.8
>
>         Attachments: SOLR-2844.patch, SOLR-2844.patch
>
>
> Our primary use case for SolrJ is to feed data into solr. We commonly use an 
> adapter design pattern in our presentation or export layer in the 
> application. E.g. an adapter to flatten structured relational data for books 
> for an solr import might look like this:
> class Book {
>   BookEntity book;
>   public String getTitle() { return book.getTitle(); }
>   public String getAuthorName() { return book.getAuthor().getName(); }
>   public Double getMinimumPrice( { return 
> priceService.calculateMinimumPrice(book); }
> }
> This is not working currently, because a setter has to be specified. So the 
> workaround is to write this code:
> class Book {
>   BookEntity book;
>   public String getTitle() { return book.getTitle(); }
>   @Field public void setTitle(String s) { }
>   public String getAuthorName() { return book.getAuthor().getName(); }
>   @Field public void setAutherName(String s) { }
>   public Double getMinimumPrice( { return 
> priceService.calculateMinimumPrice(book); }
>   @Field public void setMinimumPrice(Double d) { }
> }
> So the scope of this improvement is to get rid of the dummy setters and to 
> support @Field on getters directly.
> I will add a patch proposal for this later on.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to