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 sarat chandra <sa...@gmail.com> on 2017/12/08 11:07:00 UTC

Conditional based Filters on SolrConfig.xml

HI

Currently we have a request handler contains appends option like below

<lst name="appends">
  <str name="fq">inStock:true</str></lst>



Now i want to append this filter to query on conditional based.
If my request query contains a flag or if the flag is true, i need to
append the above filter to query, otherwise the filter should not append to
query.

how can i achieve this kind of behavior ?






-- 
--with regards
SARAT CHANDRA

Re: Conditional based Filters on SolrConfig.xml

Posted by Shawn Heisey <ap...@elyograg.org>.
On 12/8/2017 4:07 AM, sarat chandra wrote:
> Currently we have a request handler contains appends option like below
>
> <lst name="appends">
>   <str name="fq">inStock:true</str></lst>
>
> Now i want to append this filter to query on conditional based.
> If my request query contains a flag or if the flag is true, i need to
> append the above filter to query, otherwise the filter should not append to
> query.
>
> how can i achieve this kind of behavior ?

This is going to require custom code.  If you want it to happen inside
Solr, then the custom code would be a handler plugin.

It would probably be *much* easier on the client side, since it is
likely that you already have custom code there.  The client can make the
decision about what parameters should be in the request, instead of
relying on the server to add them.

Thanks,
Shawn