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 mganeshs <mg...@live.in> on 2017/05/31 11:58:40 UTC

SOLR query validation

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.

Re: SOLR query validation

Posted by Erick Erickson <er...@gmail.com>.
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 <su...@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 <mg...@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.
>>

Re: SOLR query validation

Posted by Susheel Kumar <su...@gmail.com>.
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 <mg...@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.
>