You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Rohit Harchandani <rh...@gmail.com> on 2013/08/13 20:26:36 UTC

adding custom fields to solr response

Hi,
I have created a custom component with some post filtering ability. Now I
am trying to add certain fields to the solr response. I was able to add it
as a separate response section, but i am having difficulty adding it to the
docs themselves. Is there an example of any component which adds fields to
the docs using DocTransformer ?
Thanks,
Rohit

Re: adding custom fields to solr response

Posted by Jack Krupansky <ja...@basetechnology.com>.
The "fl" field controls what appears for documents in the response.

You can add function queries to the fl list, including aliases, such as:

fl=*,Four:sum(2,2)

You could do a custom writer if you really need to "mangle" the actually 
document output.

The bottom line is that fl will determine what gets output for a document, 
so you would have the "mangle" the "returnFields" list for the query  to add 
additional items.

-- Jack Krupansky

-----Original Message----- 
From: Rohit Harchandani
Sent: Tuesday, August 13, 2013 2:26 PM
To: solr-user@lucene.apache.org
Subject: adding custom fields to solr response

Hi,
I have created a custom component with some post filtering ability. Now I
am trying to add certain fields to the solr response. I was able to add it
as a separate response section, but i am having difficulty adding it to the
docs themselves. Is there an example of any component which adds fields to
the docs using DocTransformer ?
Thanks,
Rohit