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 bbarani <bb...@gmail.com> on 2014/09/03 21:11:22 UTC

Is there a way to modify the request handler parameters dynamically?

Hi,

I need to change the components (inside a request handler) dynamically using
query parameters instead of creating multiple request handlers. Is it
possible to do this on the fly from the query?

For Ex:

change the highlight search component to use different search component
based on a query parameter

<requestHandler class="solr.StandardRequestHandler" name="/test">

 <arr name="components">
      <str>filterbyrole</str>
      <str>landingPage</str>
      <str>firstRulesComp</str>
      <str>query</str>
*      <str>highlight</str>
*      <str>facet</str>
      <str>spellcheck</str>
      <str>lastRulesComp</str>
      <str>debug</str>
      <str>elevator</str>
    </arr>
  </requestHandler>




--
View this message in context: http://lucene.472066.n3.nabble.com/Is-there-a-way-to-modify-the-request-handler-parameters-dynamically-tp4156697.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Is there a way to modify the request handler parameters dynamically?

Posted by Chris Hostetter <ho...@fucit.org>.
: change the highlight search component to use different search component
: based on a query parameter

What do you mean by "use different search component" ? 

Differnet how?

What is the actual use case / goal you are trying to achieve?

https://people.apache.org/~hossman/#xyproblem
XY Problem

Your question appears to be an "XY Problem" ... that is: you are dealing
with "X", you are assuming "Y" will help you, and you are asking about "Y"
without giving more details about the "X" so that we can understand the
full issue.  Perhaps the best solution doesn't involve "Y" at all?
See Also: http://www.perlmonks.org/index.pl?node_id=542341



-Hoss
http://www.lucidworks.com/

Re: Is there a way to modify the request handler parameters dynamically?

Posted by Ahmet Arslan <io...@yahoo.com.INVALID>.
Hi,

You can skip certain components. Every component has a name, if you set its name to false, it is skipped. Example : facet=false or query=false

but you cannot change order of them. You need a custom RequestHandler for that.

Ahmet



On Wednesday, September 3, 2014 10:12 PM, bbarani <bb...@gmail.com> wrote:
Hi,

I need to change the components (inside a request handler) dynamically using
query parameters instead of creating multiple request handlers. Is it
possible to do this on the fly from the query?

For Ex:

change the highlight search component to use different search component
based on a query parameter

<requestHandler class="solr.StandardRequestHandler" name="/test">

<arr name="components">
      <str>filterbyrole</str>
      <str>landingPage</str>
      <str>firstRulesComp</str>
      <str>query</str>
*      <str>highlight</str>
*      <str>facet</str>
      <str>spellcheck</str>
      <str>lastRulesComp</str>
      <str>debug</str>
      <str>elevator</str>
    </arr>
  </requestHandler>




--
View this message in context: http://lucene.472066.n3.nabble.com/Is-there-a-way-to-modify-the-request-handler-parameters-dynamically-tp4156697.html
Sent from the Solr - User mailing list archive at Nabble.com.