About adding fields, consider adding a custom DocumentTransformer instead, that's much less invasive.
Best, Erick On Wed, May 31, 2017 at 5:36 AM, Susheel Kumar <susheel2...@gmail.com> wrote: > Some of these like restricting user to not query some fields (based on > their authorization) etc. we do in our service layer. The service layer is > what exposed to consumers and this service connects to Solr using SolrJ to > execute queries etc. and get back results (in binary format). > > This is one of the option where you can add you additional data to your > search results which is not present in Solr and return accordingly... > > On Wed, May 31, 2017 at 7:58 AM, mganeshs <mgane...@live.in> wrote: > >> Hi, >> >> In my use case, we need to validate the solr query which is getting fired >> to >> SOLR in the solr layer. >> >> Validation like, we want few fields to be passed always in the query, we >> don't want few fields not to be passed in the query. >> >> Which is the right place to do in the SOLR ? Currently we are using it in >> Filter level. Is there any other better place to validate the query before >> handing over the query to execute. >> >> Also, in the response, we would like to add the few fields additional, for >> example, for each document fields, say for Employee document, we will >> have >> only employee id. But we would like to add employee name as well in the >> response. This is because employee name is not indexed or stored in the >> document, but only employee id is stored and indexed. So we want to get >> employee name from our store and add it in the response. Currently we are >> doing this by implementing QueryResponseWriter interface. Is there any >> better alternative for this ? >> >> Early responses would be appreciated ! >> >> Thanks and Regards, >> >> >> >> -- >> View this message in context: http://lucene.472066.n3. >> nabble.com/SOLR-query-validation-tp4338183.html >> Sent from the Solr - User mailing list archive at Nabble.com. >>