[jira] [Commented] (SOLR-12402) factor out a SolrDefaultStreamFactory class

2018-07-31 Thread ASF subversion and git services (JIRA)


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

ASF subversion and git services commented on SOLR-12402:


Commit ebb23f0077b9451eecdab395e94eea6fce42faff in lucene-solr's branch 
refs/heads/branch_7x from [~cpoerschke]
[ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=ebb23f0 ]

SOLR-12402: Factor out SolrDefaultStreamFactory class.


> factor out a SolrDefaultStreamFactory class
> ---
>
> Key: SOLR-12402
> URL: https://issues.apache.org/jira/browse/SOLR-12402
> Project: Solr
>  Issue Type: Task
>  Components: streaming expressions
>Reporter: Christine Poerschke
>Assignee: Christine Poerschke
>Priority: Minor
> Attachments: SOLR-12402.patch
>
>
> Two motivations behind the proposed factoring out:
> * discoverability of solr/solrj Lang vs. solr/core Lucene/Solr functions
> * support for custom classes that require access to a SolrResourceLoader



--
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-12402) factor out a SolrDefaultStreamFactory class

2018-07-31 Thread ASF subversion and git services (JIRA)


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

ASF subversion and git services commented on SOLR-12402:


Commit 4a1ee046c37615b3927737618c9a4c937bd6ede9 in lucene-solr's branch 
refs/heads/master from [~cpoerschke]
[ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=4a1ee04 ]

SOLR-12402: Factor out SolrDefaultStreamFactory class.


> factor out a SolrDefaultStreamFactory class
> ---
>
> Key: SOLR-12402
> URL: https://issues.apache.org/jira/browse/SOLR-12402
> Project: Solr
>  Issue Type: Task
>  Components: streaming expressions
>Reporter: Christine Poerschke
>Assignee: Christine Poerschke
>Priority: Minor
> Attachments: SOLR-12402.patch
>
>
> Two motivations behind the proposed factoring out:
> * discoverability of solr/solrj Lang vs. solr/core Lucene/Solr functions
> * support for custom classes that require access to a SolrResourceLoader



--
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-12402) factor out a SolrDefaultStreamFactory class

2018-06-05 Thread Christine Poerschke (JIRA)


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

Christine Poerschke commented on SOLR-12402:


This SOLR-12402 ticket here builds upon SOLR-12036 which in turn built upon the 
SOLR-12174 refactoring.

[~joel.bernstein] - would you have any thoughts on the (small) attached patch? 
I think it would be nice for these three to jointly be in the 7.4 release.

> factor out a SolrDefaultStreamFactory class
> ---
>
> Key: SOLR-12402
> URL: https://issues.apache.org/jira/browse/SOLR-12402
> Project: Solr
>  Issue Type: Task
>  Components: streaming expressions
>Reporter: Christine Poerschke
>Assignee: Christine Poerschke
>Priority: Minor
> Attachments: SOLR-12402.patch
>
>
> Two motivations behind the proposed factoring out:
> * discoverability of solr/solrj Lang vs. solr/core Lucene/Solr functions
> * support for custom classes that require access to a SolrResourceLoader



--
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-12402) factor out a SolrDefaultStreamFactory class

2018-06-01 Thread Christine Poerschke (JIRA)


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

Christine Poerschke commented on SOLR-12402:


ticket cross-reference: 
https://github.com/deeplearning4j/deeplearning4j/pull/5429 has started to turn 
the above illustration into an actual {{ModelTupleStream}} class

> factor out a SolrDefaultStreamFactory class
> ---
>
> Key: SOLR-12402
> URL: https://issues.apache.org/jira/browse/SOLR-12402
> Project: Solr
>  Issue Type: Task
>  Components: streaming expressions
>Reporter: Christine Poerschke
>Assignee: Christine Poerschke
>Priority: Minor
> Attachments: SOLR-12402.patch
>
>
> Two motivations behind the proposed factoring out:
> * discoverability of solr/solrj Lang vs. solr/core Lucene/Solr functions
> * support for custom classes that require access to a SolrResourceLoader



--
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-12402) factor out a SolrDefaultStreamFactory class

2018-05-25 Thread Christine Poerschke (JIRA)

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

Christine Poerschke commented on SOLR-12402:


Here's a outline example of what a custom class requiring access to a 
{{SolrResourceLoader}} might look like. There are some similarities to the 
https://github.com/deeplearning4j/deeplearning4j/blob/deeplearning4j-1.0.0-beta/deeplearning4j-modelexport-solr/src/main/java/org/deeplearning4j/nn/modelexport/solr/ltr/model/ScoringModel.java
 class.

Illustration:
{code}
package org.deeplearning4j.nn.modelexport.solr.handler;

...
import org.deeplearning4j.nn.api.Model;
...

/**
 * ...
 * Illustrative configuration snippet:
 * 
  
org.deeplearning4j.nn.modelexport.solr.handler.ModelTupleStream
 
  

 * ...
 * Illustrative expression snippet:
 * 
  emailModel(search(myCollection,
q="*:*",
fl="id,fieldX,fieldY,fieldZ",
sort="id asc",
qt="/export"),
 serializedModelFileName="mySerializedModel",
 inputFields="fieldX,fieldY,fieldZ",
 outputField="modelScoreField")

 * 
 * Apache Solr Reference Guide:
 * 
 *  https://lucene.apache.org/solr/guide/7_3/streaming-expressions.html;>Streaming
 Expressions
 * 
 */

public static class ModelTupleStream extends TupleStream implements Expressible 
{

  final private TupleStream tupleStream;
  final private String serializedModelFileName;
  final private Model model;
  final private String[] inputFields;
  final private String[] outputField;

  public ModelTupleStream(StreamExpression streamExpression, StreamFactory 
streamFactory) throws IOException {

...

this.tupleStream = streamFactory.constructStream(...);

this.serializedModelFileName = ... 
streamFactory.getNamedOperand(streamExpression, "serializedModelFileName") ...
if (!(streamFactory instanceof SolrDefaultStreamFactory)) {
  throw new IOException(...);
}

final SolrResourceLoader solrResourceLoader = 
((SolrDefaultStreamFactory)streamFactory).getSolrResourceLoader();
final InputStream inputStream = 
solrResourceLoader.openResource(serializedModelFileName);
this.model = ModelGuesser.loadModelGuess(inputStream);
  }

  @Override
  public Tuple read() throws IOException;
  {
Tuple tuple = tupleStream.read();
if (!tuple.EOF) {
  for ... inputFields ...
  ... tuple.getDouble(inputFields[ii]) ...
  outputValue = model(inputValues);
  tuple.put(this.outputField, outputValue);
}
return tuple;
  }

  ...

}
{code}

> factor out a SolrDefaultStreamFactory class
> ---
>
> Key: SOLR-12402
> URL: https://issues.apache.org/jira/browse/SOLR-12402
> Project: Solr
>  Issue Type: Task
>  Components: streaming expressions
>Reporter: Christine Poerschke
>Assignee: Christine Poerschke
>Priority: Minor
> Attachments: SOLR-12402.patch
>
>
> Two motivations behind the proposed factoring out:
> * discoverability of solr/solrj Lang vs. solr/core Lucene/Solr functions
> * support for custom classes that require access to a SolrResourceLoader



--
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