lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Binoy Dalal <binoydala...@gmail.com>
Subject Re: Capture facets and its values in output and modify them
Date Sat, 27 Feb 2016 08:31:58 GMT
Here's the code snippet for highlighting but you just replace highlighting
with 'facet' adn do what you want with it.

public void process(ResponseBuilder arg0) throws IOException {
NamedList nl = arg0.rsp.getValues();
SimpleOrderedMap sop = (SimpleOrderedMap) nl.get("highlighting");
                // DO YOUR THING
}

On Sat, Feb 27, 2016 at 1:46 PM Binoy Dalal <binoydalal93@gmail.com> wrote:

> Take a look here:
> https://github.com/lttazz99/SolrPluginsExamples/blob/master/src/main/java/component/ComponentDemo.java
>
> I've uploaded an example of writing a search component.
> All you have to do is get the facet object from the solr response and then
> work in it.
> I have done something similar with highlighting and will put that code
> here in some time so you know how to fetch the facet values.
>
> On Sat, 27 Feb 2016, 13:42 Mark Robinson <mark123learns@gmail.com> wrote:
>
>> Hi,
>> I have a requirement to capture facet fields in the output and append an
>> additional data to
>> each of the facet values before the final output (along with the results
>> as
>> well as the facets and values) is send back so that a middle layer can use
>> this additional value added.
>>
>> I read that a custom search component will do this, but could some one
>> please point to how I could get access to the facets and its values (a
>> small code snippet or any resource which points to it).
>>
>> Thanks!
>> Mark
>>
> --
> Regards,
> Binoy Dalal
>
-- 
Regards,
Binoy Dalal

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message