I’ve long wished that Solr had a query pipeline similar to it’s update 
pipeline.  It’s a common feature of other search engines, and it gives a 
natural home for things like this to occur.   Today, I think your best route 
would be to make your own response writer…. Solr is Super pluggable that way 
;-).

wt=myJsonFormat

The only other idea I have, is if you could use xml, then you could write your 
own XSLT….    

You could imagine doing a similar idea as xslt style sheets for JSON???

> On Dec 8, 2022, at 3:42 AM, Thomas Corthals <tho...@klascement.net> wrote:
> 
> Hi Matthew
> 
> Do you mean you want to relabel the field names in the reply? They can be
> aliased.
> 
> https://solr.apache.org/guide/solr/latest/query-guide/common-query-parameters.html#field-name-aliases
> 
> IIRC, there's no way to guarantee the order of the fields in the response.
> It's probably the order in which they were indexed. But I wouldn't let my
> code depend on that assumption.
> 
> Thomas
> 
> Op wo 7 dec. 2022 om 23:31 schreef Matthew Castrigno <castr...@slhs.org>:
> 
>> Hi Mikhail,
>> 
>> Yes I was reading this section but it was not clear to me how I could
>> accomplish what I need to do with these resources other that writing my own
>> responseWriter. I want to take the key value pairs of the response and
>> change the name of the keys,  for example and make changes to the
>> arrangement of the repsonse.
>> 
>> Thanks.
>> ________________________________
>> From: Mikhail Khludnev <m...@apache.org>
>> Sent: Wednesday, December 7, 2022 3:12 PM
>> To: users@solr.apache.org <users@solr.apache.org>
>> Subject: Re: Is there a way to shape a query response from SOLR similar to
>> the way the Script Update Processor can transform an update
>> payload/document?
>> 
>> Hello Matthew, Will wt=json https: //urldefense. com/v3/__https: //solr.
>> apache. org/guide/7_1/common-query-parameters.
>> html*wt-parameter__;Iw!!FkC3_z_N!NQB65JQR777QCb_Aypbo3QDqBejimEzP-Ea_ISX30_8FS9Y6EsMRy1lGOaOHoi5d2OjvKWWmtw$
>> work for it? On Wed,
>> ZjQcmQRYFpfptBannerStart
>> This Message Is From an External Sender
>> This message came from outside the St. Luke's email system.
>> 
>> ZjQcmQRYFpfptBannerEnd
>> 
>> Hello Matthew,
>> Will wt=json
>> 
>> https://urldefense.com/v3/__https://solr.apache.org/guide/7_1/common-query-parameters.html*wt-parameter__;Iw!!FkC3_z_N!NQB65JQR777QCb_Aypbo3QDqBejimEzP-Ea_ISX30_8FS9Y6EsMRy1lGOaOHoi5d2OjvKWWmtw$
>> work for it?
>> 
>> On Wed, Dec 7, 2022 at 8:19 PM Matthew Castrigno <castr...@slhs.org>
>> wrote:
>> 
>>> I need to shape Json the response from SOLR, is there a way to do that?
>>> 
>>> Thank you.
>>> 
>>> ----------------------------------------------------------------------
>>> "This message is intended for the use of the person or entity to which it
>>> is addressed and may contain information that is confidential or
>>> privileged, the disclosure of which is governed by applicable law. If the
>>> reader of this message is not the intended recipient, you are hereby
>>> notified that any dissemination, distribution, or copying of this
>>> information is strictly prohibited. If you have received this message by
>>> error, please notify us immediately and destroy the related message."
>>> 
>> 
>> 
>> --
>> Sincerely yours
>> Mikhail Khludnev
>> 
>> 
>> ----------------------------------------------------------------------
>> "This message is intended for the use of the person or entity to which it
>> is addressed and may contain information that is confidential or
>> privileged, the disclosure of which is governed by applicable law. If the
>> reader of this message is not the intended recipient, you are hereby
>> notified that any dissemination, distribution, or copying of this
>> information is strictly prohibited. If you have received this message by
>> error, please notify us immediately and destroy the related message."
>> 

_______________________
Eric Pugh | Founder & CEO | OpenSource Connections, LLC | 434.466.1467 | 
http://www.opensourceconnections.com <http://www.opensourceconnections.com/> | 
My Free/Busy <http://tinyurl.com/eric-cal>  
Co-Author: Apache Solr Enterprise Search Server, 3rd Ed 
<https://www.packtpub.com/big-data-and-business-intelligence/apache-solr-enterprise-search-server-third-edition-raw>
    
This e-mail and all contents, including attachments, is considered to be 
Company Confidential unless explicitly stated otherwise, regardless of whether 
attachments are marked as such.

Reply via email to