[
https://issues.apache.org/jira/browse/SOLR-5005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13701647#comment-13701647
]
Karthick Duraisamy Soundararaj commented on SOLR-5005:
------------------------------------------------------
Jack,
2. Is this a stand alone request handler that does nothing other than what is
in the script, or does it subclass the search handler? If the latter, where in
the query "lifecycle" does it hook in? If the former, how exactly does the
script invoke the pieces of the traditional query processing lifecycle? Maybe
both are needed.
This request handler extends search handler. The script has two functions,
preRequest & postRequest called before and after making a call to
SearchHandler.handleRequest(req,rsp). As an example, for the following
configuration, firstRequest's preRequest function will be invoked, then
searchHandler's handleRequestBody followed by firstRequest's postRequest
method.
<requestHandler name="/select1" class="solr.ScriptSearchHandler">
<str name="script">firstRequest.js</str>
</requestHandler>
1. How about supporting "params" just as the
StatelessScripteUpdateProcessorFactory does?
The preRequest hook can modify/add/remove the params through the reqParams,
which is an instance of ModifiableSolrParams. Considering, the main goal of
this scriptSearchHandler is to edit the params dynamically, I thought we might
not actually need params.
3. What methods (full JS signature) would a Script RH need to implement?
function preRequest() { /* Use the references : reqParams, request, response */}
function postRequest() { /* Use the references : request, response */}
> ScriptRequestHandler
> --------------------
>
> Key: SOLR-5005
> URL: https://issues.apache.org/jira/browse/SOLR-5005
> Project: Solr
> Issue Type: New Feature
> Reporter: David Smiley
> Attachments: patch
>
>
> A user customizable script based request handler would be very useful. It's
> inspired from the ScriptUpdateRequestProcessor, but on the search end. A user
> could write a script that submits searches to Solr (in-VM) and can react to
> the results of one search before making another that is formulated
> dynamically. And it can assemble the response data, potentially reducing
> both the latency and data that would move over the wire if this feature
> didn't exist. It could also be used to easily add a user-specifiable search
> API at the Solr server with request parameters governed by what the user
> wants to advertise -- especially useful within enterprises. And, it could be
> used to enforce security requirements on allowable parameter valuables to
> Solr, so a javascript based Solr client could be allowed to talk to only a
> script based request handler which enforces the rules.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]