Instead of putting this into Solr, did you consider adding this logic into the service that will call Solr?
On Tue, Dec 19, 2017 at 4:41 PM, Solrmails <solrma...@protonmail.com> wrote: > Thank you for your answer. I'd like to restrict the returned fields > dynamicaly based on a permission system. I think modifieng the "getParams" > collection to add fl within the 'handleRequestBody'(CustomSearchHandler) > should do the work? > > Sent with [ProtonMail](https://protonmail.com) Secure Email. > >> -------- Original Message -------- >> Subject: Re: How to restrict the fields solr returns? >> Local Time: 19 December 2017 2:23 PM >> UTC Time: 19 December 2017 13:23 >> From: diego.ceccare...@gmail.com >> To: solr-user@lucene.apache.org, Solrmails <solrma...@protonmail.com> >> >> If you need to return only a subset of the fields for each request you can >> set them as default in the solrconfig.xml. >> >> On Dec 19, 2017 13:45, "Solrmails" solrma...@protonmail.com wrote: >> >>> I found a solution: I created a custom Search Handler and overridden >>> 'handleRequestBody'. Then I modify the "getParams" collection within >>> 'handleRequestBody' to enforce the fl param. >>> Sent with [ProtonMail](https://protonmail.com) Secure Email. >>> >>>> -------- Original Message -------- >>>> Subject: Re: How to restrict the fields solr returns? >>>> Local Time: 19 December 2017 1:02 PM >>>> UTC Time: 19 December 2017 12:02 >>>> From: rl...@leirtech.com >>>> To: solr-user@lucene.apache.org >>>> The fl parameter is used for this. >>>> On December 19, 2017 3:22:59 AM EST, Solrmails solrma...@protonmail.com >>>> wrote: >>>> >>>>> Hey >>>>> I'm using a custom "QParserPlugin" to restrict which documents are >>>>> returned to the user. >>>>> Now I'd like to restrict also the fields that are returned with a >>>>> document. I couldn't find a good entry point to do such a restriction. >>>>> Maybe I could missuse a "QueryResponseWriter" plugin but that sounds >>>>> like a bad idea. >>>>> Any other ideas? >>>>> -- >>>>> Sorry for being brief. Alternate email is rickleir at yahoo dot com