You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by cp...@apache.org on 2017/05/25 17:55:33 UTC
[24/44] lucene-solr:jira/solr-8668: SOLR-10731: Add first test case
SOLR-10731: Add first test case
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/cc87181c
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/cc87181c
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/cc87181c
Branch: refs/heads/jira/solr-8668
Commit: cc87181c54f10dec809dc9dbd876fa750f1d6461
Parents: 89d48df
Author: Joel Bernstein <jb...@apache.org>
Authored: Tue May 23 20:05:08 2017 -0400
Committer: Joel Bernstein <jb...@apache.org>
Committed: Wed May 24 07:59:01 2017 -0400
----------------------------------------------------------------------
.../solrj/io/stream/StreamExpressionTest.java | 23 +++++---------------
1 file changed, 5 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/cc87181c/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
index d464989..dc3a380 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
@@ -925,36 +925,23 @@ public class StreamExpressionTest extends SolrCloudTestCase {
public void testKnnStream() throws Exception {
UpdateRequest update = new UpdateRequest();
-
update.add(id, "1", "a_t", "hello world have a very nice day blah");
- update.add(id, "2", "a_t", "hello world have a very nice day fancy sky");
- update.add(id, "3", "a_t", "hello world have a very nice bug out");
update.add(id, "4", "a_t", "hello world have a very streaming is fun");
-
-
+ update.add(id, "3", "a_t", "hello world have a very nice bug out");
+ update.add(id, "2", "a_t", "hello world have a very nice day fancy sky");
update.commit(cluster.getSolrClient(), COLLECTIONORALIAS);
- StreamExpression expression;
- TupleStream stream;
-
- StreamFactory factory = new StreamFactory()
- .withCollectionZkHost(COLLECTIONORALIAS, cluster.getZkServer().getZkAddress())
- .withFunctionName("random", RandomStream.class);
-
-
StreamContext context = new StreamContext();
SolrClientCache cache = new SolrClientCache();
try {
context.setSolrClientCache(cache);
-
ModifiableSolrParams sParams = new ModifiableSolrParams(StreamingTest.mapParams(CommonParams.QT, "/stream"));
- sParams.add("expr", "knn(" + COLLECTIONORALIAS + ", id=\"1\", qf=\"a_t\", rows=\"4\", fl=\"id\")");
+ sParams.add("expr", "knn(" + COLLECTIONORALIAS + ", id=\"1\", qf=\"a_t\", rows=\"4\", fl=\"id, score\", mintf=\"1\")");
JettySolrRunner jetty = cluster.getJettySolrRunner(0);
SolrStream solrStream = new SolrStream(jetty.getBaseUrl().toString() + "/collection1", sParams);
List<Tuple> tuples = getTuples(solrStream);
- System.out.println("## Tuples:"+tuples.size());
- assertTrue(tuples.size() == 4);
-
+ assertTrue(tuples.size() == 3);
+ assertOrder(tuples,2,3,4);
} finally {
cache.close();
}