Re: Turn on/off query based on a url parameter

2018-02-23 Thread Roopa Rao
Thanks,
I got it working as below, features is true or false based on the efi
parameter is_var. (Field and value should be substituted with correct names)

{
"store": "featurestore",
"name": "isfeaturematch",
"class": "org.apache.solr.ltr.feature.SolrFeature",
"params": {
"q": "{!func}and(${is_var:false}, query({!v='field:value'}))"
}
}


On Thu, Feb 22, 2018 at 2:46 PM, Phil Scadden <p.scad...@gns.cri.nz> wrote:

> I always filter solr request via a proxy (so solr itself is not exposed
> directly to the web). In that proxy, the query parameters can be broken
> down and filtered as desired (I examine authorities granted to a session to
> control even which indexes are being searched) before passing the modified
> url to solr. The coding of the proxy obviously depends on your application
> environment. We use java and Spring.
>
> -Original Message-
> From: Roopa Rao [mailto:roop...@gmail.com]
> Sent: Friday, 23 February 2018 8:04 a.m.
> To: solr-user@lucene.apache.org
> Subject: Turn on/off query based on a url parameter
>
> Hi,
>
> I want to enable or disable a SolrFeature in LTR based on efi parameter.
>
> In simple the query should be executed only if a parameter is true.
>
> Any examples or suggestion on how to accomplish this?
>
> Functions queries examples are are using fields to give a value to. In my
> case I want to execute the query only if a url parameter is true
>
> Thanks,
> Roopa
> Notice: This email and any attachments are confidential and may not be
> used, published or redistributed without the prior written consent of the
> Institute of Geological and Nuclear Sciences Limited (GNS Science). If
> received in error please destroy and immediately notify GNS Science. Do not
> copy or disclose the contents.
>


RE: Turn on/off query based on a url parameter

2018-02-22 Thread Phil Scadden
I always filter solr request via a proxy (so solr itself is not exposed 
directly to the web). In that proxy, the query parameters can be broken down 
and filtered as desired (I examine authorities granted to a session to control 
even which indexes are being searched) before passing the modified url to solr. 
The coding of the proxy obviously depends on your application environment. We 
use java and Spring.

-Original Message-
From: Roopa Rao [mailto:roop...@gmail.com]
Sent: Friday, 23 February 2018 8:04 a.m.
To: solr-user@lucene.apache.org
Subject: Turn on/off query based on a url parameter

Hi,

I want to enable or disable a SolrFeature in LTR based on efi parameter.

In simple the query should be executed only if a parameter is true.

Any examples or suggestion on how to accomplish this?

Functions queries examples are are using fields to give a value to. In my case 
I want to execute the query only if a url parameter is true

Thanks,
Roopa
Notice: This email and any attachments are confidential and may not be used, 
published or redistributed without the prior written consent of the Institute 
of Geological and Nuclear Sciences Limited (GNS Science). If received in error 
please destroy and immediately notify GNS Science. Do not copy or disclose the 
contents.


Turn on/off query based on a url parameter

2018-02-22 Thread Roopa Rao
Hi,

I want to enable or disable a SolrFeature in LTR based on efi parameter.

In simple the query should be executed only if a parameter is true.

Any examples or suggestion on how to accomplish this?

Functions queries examples are are using fields to give a value to. In my
case I want to execute the query only if a url parameter is true

Thanks,
Roopa