You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by jb...@apache.org on 2017/06/09 16:10:12 UTC

[1/2] lucene-solr:branch_6x: SOLR-10855: Null pointer exceptions in CartesianProductStream toExpression and explain methods

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6x cf52cdde0 -> 3bdf58b16


SOLR-10855: Null pointer exceptions in CartesianProductStream toExpression and explain methods


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/32d93ae0
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/32d93ae0
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/32d93ae0

Branch: refs/heads/branch_6x
Commit: 32d93ae05befee53331986248c34c79a5472a82c
Parents: cf52cdd
Author: Joel Bernstein <jb...@apache.org>
Authored: Thu Jun 8 20:55:20 2017 -0400
Committer: Joel Bernstein <jb...@apache.org>
Committed: Fri Jun 9 12:09:27 2017 -0400

----------------------------------------------------------------------
 .../client/solrj/io/stream/CartesianProductStream.java  | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/32d93ae0/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CartesianProductStream.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CartesianProductStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CartesianProductStream.java
index 6514ae4..c96b9fe 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CartesianProductStream.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CartesianProductStream.java
@@ -150,8 +150,10 @@ public class CartesianProductStream extends TupleStream implements Expressible {
     for(NamedEvaluator evaluator : evaluators) {
       expression.addParameter(String.format(Locale.ROOT, "%s as %s", evaluator.getEvaluator().toExpression(factory), evaluator.getName()));
     }
-    
-    expression.addParameter(new StreamExpressionNamedParameter("productSort", orderBy.toExpression(factory)));
+
+    if(orderBy != null) {
+      expression.addParameter(new StreamExpressionNamedParameter("productSort", orderBy.toExpression(factory)));
+    }
     
     return expression;   
   }
@@ -171,8 +173,10 @@ public class CartesianProductStream extends TupleStream implements Expressible {
     for(NamedEvaluator evaluator : evaluators){
       explanation.addHelper(evaluator.getEvaluator().toExplanation(factory));
     }
-    
-    explanation.addHelper(orderBy.toExplanation(factory));
+
+    if(orderBy != null) {
+      explanation.addHelper(orderBy.toExplanation(factory));
+    }
     
     return explanation;
   }


[2/2] lucene-solr:branch_6x: Ref Guide: Add knn documentations

Posted by jb...@apache.org.
Ref Guide: Add knn documentations


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/3bdf58b1
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/3bdf58b1
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/3bdf58b1

Branch: refs/heads/branch_6x
Commit: 3bdf58b16ea3093ce3595b3ae27348d0013413c9
Parents: 32d93ae
Author: Joel Bernstein <jb...@apache.org>
Authored: Fri Jun 9 11:55:11 2017 -0400
Committer: Joel Bernstein <jb...@apache.org>
Committed: Fri Jun 9 12:09:51 2017 -0400

----------------------------------------------------------------------
 solr/solr-ref-guide/src/stream-sources.adoc | 32 ++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/3bdf58b1/solr/solr-ref-guide/src/stream-sources.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/stream-sources.adoc b/solr/solr-ref-guide/src/stream-sources.adoc
index 97a1ca4..f2e001a 100644
--- a/solr/solr-ref-guide/src/stream-sources.adoc
+++ b/solr/solr-ref-guide/src/stream-sources.adoc
@@ -217,6 +217,36 @@ features(collection1,
 
 The `gatherNodes` function provides breadth-first graph traversal. For details, see the section <<graph-traversal.adoc#graph-traversal,Graph Traversal>>.
 
+== knn
+
+The `knn` function returns the K nearest neighbors for a document based on text similarity. Under the covers the `knn` function
+use the More Like This query parser plugin.
+
+=== knn Parameters
+
+* `collection`: (Mandatory) The collection to perform the search in.
+* `id`: (Mandatory) The id of the source document to begin the knn search from.
+* `qf`: (Mandatory) The query field used to compare documents.
+* `fl`: (Mandatory) The field list returned.
+* `mintf`: (Mandatory) The minimum numer of occurrences of the term in the source document to be inlcued in the search.
+* `maxtf`: (Mandatory) The maximum numer of occurrences of the term in the source document to be inlcued in the search.
+* `mindf`: (Mandatory) The minimum numer of occurrences in the corpus to be inlcued in the search.
+* `maxdf`: (Mandatory) The maximum numer of occurrences in the corpus to be inlcued in the search.
+* `minwl`: (Mandatory) The minimum world length of to be inlcued in the search.
+* `maxwl`: (Mandatory) The maximum world length of to be inlcued in the search.
+
+=== knn Syntax
+
+[source,text]
+----
+knn(collection1,
+    id="doc1",
+    qf="text_field",
+    fl="id, title",
+    mintf="3",
+    maxdf="10000000")
+----
+
 == model
 
 The `model` function retrieves and caches logistic regression text classification models that are stored in a SolrCloud collection. The `model` function is designed to work with models that are created by the <<train,train function>>, but can also be used to retrieve text classification models trained outside of Solr, as long as they conform to the specified format. After the model is retrieved it can be used by the <<stream-decorators.adoc#classify,classify function>> to classify documents.
@@ -401,6 +431,7 @@ JSON Facet API as its high performance aggregation engine.
 * `start`: (Mandatory) The start of the time series expressed in Solr date or date math syntax.
 * `end`: (Mandatory) The end of the time series expressed in Solr date or date math syntax.
 * `gap`: (Mandatory) The time gap between time series aggregation points expressed in Solr date math syntax.
+* `format`: (Optional) Date template to format the date field in the output tuples. Formatting is performed by Java's SimpleDateFormat class.
 * `metrics`: (Mandatory) The metrics to include in the result tuple. Current supported metrics are `sum(col)`, `avg(col)`, `min(col)`, `max(col)` and `count(*)`
 
 === timeseries Syntax
@@ -413,6 +444,7 @@ timeseries(collection1,
            start="NOW-30DAYS",
            end="NOW",
            gap="+1DAY",
+           format="YYYY-MM-dd",
            sum(a_i),
            max(a_i),
            max(a_f),