[jira] [Commented] (SOLR-13511) For SearchHandler, expose "new ResponseBuilder()" to allow override

2019-06-14 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-13511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16863992#comment-16863992
 ] 

ASF subversion and git services commented on SOLR-13511:


Commit 5c65d124603b591322bdb0de92db67ed57604226 in lucene-solr's branch 
refs/heads/branch_8x from Christine Poerschke
[ https://gitbox.apache.org/repos/asf?p=lucene-solr.git;h=5c65d12 ]

SOLR-13511: Add SearchHandler.newResponseBuilder method to facilitate custom 
plugins' maintenance of per-request state in a custom ResponseBuilder. (Ramsey 
Haddad, Christine Poerschke)


> For SearchHandler, expose "new ResponseBuilder()" to allow override
> ---
>
> Key: SOLR-13511
> URL: https://issues.apache.org/jira/browse/SOLR-13511
> Project: Solr
>  Issue Type: Improvement
>  Components: search
>Reporter: Ramsey Haddad
>Assignee: Christine Poerschke
>Priority: Trivial
>  Labels: easyfix
> Attachments: SOLR-13511.patch, SOLR-13511.patch, SOLR-13511.patch
>
>
> This change is all we want upstream. To use this from our plugins, we intend:
> Extend ResponseBuilder to have additional state (and we think others might 
> want to as well).
> Use an extended SearchHandler that simply creates our ResponseBuilder instead 
> of the standard one.
> We also extend QueryComponent to do our extra behavior if it sees our 
> Response builder instead of the standard one.
> We then change config to use our Search Handler for requestHandler with 
> name="/select" and our QueryComponent for searchComponent with name="query".



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-13511) For SearchHandler, expose "new ResponseBuilder()" to allow override

2019-06-14 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-13511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16863989#comment-16863989
 ] 

ASF subversion and git services commented on SOLR-13511:


Commit 43fc05c1ed5fc408705ce7b04e83dccf6aadb396 in lucene-solr's branch 
refs/heads/master from Christine Poerschke
[ https://gitbox.apache.org/repos/asf?p=lucene-solr.git;h=43fc05c ]

SOLR-13511: Add SearchHandler.newResponseBuilder method to facilitate custom 
plugins' maintenance of per-request state in a custom ResponseBuilder. (Ramsey 
Haddad, Christine Poerschke)


> For SearchHandler, expose "new ResponseBuilder()" to allow override
> ---
>
> Key: SOLR-13511
> URL: https://issues.apache.org/jira/browse/SOLR-13511
> Project: Solr
>  Issue Type: Improvement
>  Components: search
>Reporter: Ramsey Haddad
>Assignee: Christine Poerschke
>Priority: Trivial
>  Labels: easyfix
> Attachments: SOLR-13511.patch, SOLR-13511.patch, SOLR-13511.patch
>
>
> This change is all we want upstream. To use this from our plugins, we intend:
> Extend ResponseBuilder to have additional state (and we think others might 
> want to as well).
> Use an extended SearchHandler that simply creates our ResponseBuilder instead 
> of the standard one.
> We also extend QueryComponent to do our extra behavior if it sees our 
> Response builder instead of the standard one.
> We then change config to use our Search Handler for requestHandler with 
> name="/select" and our QueryComponent for searchComponent with name="query".



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-13511) For SearchHandler, expose "new ResponseBuilder()" to allow override

2019-06-07 Thread David Smiley (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-13511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16858958#comment-16858958
 ] 

David Smiley commented on SOLR-13511:
-

+1 very nice :)

> For SearchHandler, expose "new ResponseBuilder()" to allow override
> ---
>
> Key: SOLR-13511
> URL: https://issues.apache.org/jira/browse/SOLR-13511
> Project: Solr
>  Issue Type: Improvement
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: search
>Reporter: Ramsey Haddad
>Assignee: Christine Poerschke
>Priority: Trivial
>  Labels: easyfix
> Attachments: SOLR-13511.patch, SOLR-13511.patch, SOLR-13511.patch
>
>
> This change is all we want upstream. To use this from our plugins, we intend:
> Extend ResponseBuilder to have additional state (and we think others might 
> want to as well).
> Use an extended SearchHandler that simply creates our ResponseBuilder instead 
> of the standard one.
> We also extend QueryComponent to do our extra behavior if it sees our 
> Response builder instead of the standard one.
> We then change config to use our Search Handler for requestHandler with 
> name="/select" and our QueryComponent for searchComponent with name="query".



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-13511) For SearchHandler, expose "new ResponseBuilder()" to allow override

2019-06-07 Thread Christine Poerschke (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-13511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16858879#comment-16858879
 ] 

Christine Poerschke commented on SOLR-13511:


Thanks [~rwhaddad] for opening this ticket!

So the use case, as you already mentioned, is for Solr plugin authors to be 
able to main per-request state for their plugin in a custom 
[ResponseBuilder|https://github.com/apache/lucene-solr/blob/releases/lucene-solr/8.1.1/solr/core/src/java/org/apache/solr/handler/component/ResponseBuilder.java]
 class.

* code snippets
{code}
package com.mycompany.myteam.solr;

public class CustomSearchHandler extends 
org.apache.solr.handler.component.SearchHandler {
  @Override
  protected ResponseBuilder newResponseBuilder(SolrQueryRequest req, 
SolrQueryResponse rsp, List components) {
return new CustomResponseBuilder(req, rsp, components);
  }
}

public class CustomResponseBuilder extends 
org.apache.solr.handler.component.ResponseBuilder
{
  private FooBar fooBar;

  public void setFooBar(FooBar fooBar) { this.fooBar = fooBar; }
  public FooBar getFooBar() { return this.fooBar; }

  public CustomResponseBuilder(SolrQueryRequest req, SolrQueryResponse rsp, 
List components) {
super(req, rsp, components);
  }
}

public class CustomQueryComponent extends 
org.apache.solr.handler.component.QueryComponent {
  ...
  @Override
  public void process(ResponseBuilder rb) throws IOException {
super.process(rb);
if (rb instanceof CustomResponseBuilder) {
  CustomResponseBuilder crb = (CustomResponseBuilder)rb;
  ...
  crb.setFooBar(...);
  ...
}
  }
  ...
}
{code}

* solrconfig.xml snippet:  
{code}



  
customQuery
  

{code}


Latest attached patch includes javadocs for the new method. If there are no 
objections, concerns, questions, etc. then I'll aim to commit the change middle 
of next week or so.

> For SearchHandler, expose "new ResponseBuilder()" to allow override
> ---
>
> Key: SOLR-13511
> URL: https://issues.apache.org/jira/browse/SOLR-13511
> Project: Solr
>  Issue Type: Improvement
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: search
>Reporter: Ramsey Haddad
>Priority: Trivial
>  Labels: easyfix
> Attachments: SOLR-13511.patch, SOLR-13511.patch
>
>
> This change is all we want upstream. To use this from our plugins, we intend:
> Extend ResponseBuilder to have additional state (and we think others might 
> want to as well).
> Use an extended SearchHandler that simply creates our ResponseBuilder instead 
> of the standard one.
> We also extend QueryComponent to do our extra behavior if it sees our 
> Response builder instead of the standard one.
> We then change config to use our Search Handler for requestHandler with 
> name="/select" and our QueryComponent for searchComponent with name="query".



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org