lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Noble Paul നോബിള്‍ नोब्ळ् <noble.p...@corp.aol.com>
Subject Re: Highlighting bean properties using DocumentObjectBinder - New feature?
Date Tue, 06 Oct 2009 12:03:21 GMT
go ahead but mark for 1.5

On Tue, Oct 6, 2009 at 4:50 PM, Avlesh Singh <avlesh@gmail.com> wrote:
> Does this one deserve a JIRA issue?
>
> Cheers
> Avlesh
>
> On Sun, Oct 4, 2009 at 8:37 PM, Avlesh Singh <avlesh@gmail.com> wrote:
>
>> Like most others, I use SolrJ and bind my beans with @Field annotations to
>> read responses from Solr.
>> For highlighting these properties in my bean, I always write a separate
>> piece - Get the list of highlights from response and then use the
>> Map<fieldName, List<highlights>> to put them back in my original bean.
>>
>> This evening, I tried creating an @Highlight annotation and modified the
>> DocumentObjectBinder to understand this attribute (with a bunch of other
>> properties).
>>
>> This is how it works:
>> You can annotate your beans with @Highlight as underneath.
>>
>> class MyBean{
>>   @Field
>>   @Highlight
>>   String name;
>>
>>   @Field ("solr_category_field_name")
>>   List<String> categories;
>>
>>   @Highlight ("solr_category_field_name")
>>   List<String> highlightedCategories
>>
>>   @Field
>>   float score;
>>
>>   ...
>> }
>>
>> and use QueryResponse#getBeans(MyBean.class) to achieve both - object
>> binding as well as highlighting.
>> I was wondering if this can be of help to most users or not. Can this be a
>> possible enhancement in DocumentObjectBinder? If yes, I can write a patch.
>>
>> Cheers
>> Avlesh
>>
>



-- 
-----------------------------------------------------
Noble Paul | Principal Engineer| AOL | http://aol.com

Mime
View raw message