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/07/21 15:23:04 UTC
[1/2] lucene-solr:branch_7x: SOLR-10174: fix approx. 1 of 2
@Ignore-ed tests in TestLTRReRankingPipeline.
Repository: lucene-solr
Updated Branches:
refs/heads/branch_7x 9566c1bf6 -> 5be125896
SOLR-10174: fix approx. 1 of 2 @Ignore-ed tests in TestLTRReRankingPipeline.
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/2f8b0490
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/2f8b0490
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/2f8b0490
Branch: refs/heads/branch_7x
Commit: 2f8b049019552c1e36e5845d6531d8376c79f49c
Parents: 9566c1b
Author: Christine Poerschke <cp...@apache.org>
Authored: Fri Jul 21 15:38:26 2017 +0100
Committer: Christine Poerschke <cp...@apache.org>
Committed: Fri Jul 21 16:03:30 2017 +0100
----------------------------------------------------------------------
.../apache/solr/ltr/TestLTRReRankingPipeline.java | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/2f8b0490/solr/contrib/ltr/src/test/org/apache/solr/ltr/TestLTRReRankingPipeline.java
----------------------------------------------------------------------
diff --git a/solr/contrib/ltr/src/test/org/apache/solr/ltr/TestLTRReRankingPipeline.java b/solr/contrib/ltr/src/test/org/apache/solr/ltr/TestLTRReRankingPipeline.java
index 75d3538..ed7be63 100644
--- a/solr/contrib/ltr/src/test/org/apache/solr/ltr/TestLTRReRankingPipeline.java
+++ b/solr/contrib/ltr/src/test/org/apache/solr/ltr/TestLTRReRankingPipeline.java
@@ -60,7 +60,12 @@ public class TestLTRReRankingPipeline extends LuceneTestCase {
private static final SolrResourceLoader solrResourceLoader = new SolrResourceLoader();
private IndexSearcher getSearcher(IndexReader r) {
- final IndexSearcher searcher = newSearcher(r);
+ // 'yes' to maybe wrapping in general
+ final boolean maybeWrap = true;
+ final boolean wrapWithAssertions = false;
+ // 'no' to asserting wrap because lucene AssertingWeight
+ // cannot be cast to solr LTRScoringQuery$ModelWeight
+ final IndexSearcher searcher = newSearcher(r, maybeWrap, wrapWithAssertions);
return searcher;
}
@@ -102,7 +107,6 @@ public class TestLTRReRankingPipeline extends LuceneTestCase {
}
- @Ignore
@Test
public void testRescorer() throws IOException {
final Directory dir = newDirectory();
@@ -112,7 +116,7 @@ public class TestLTRReRankingPipeline extends LuceneTestCase {
doc.add(newStringField("id", "0", Field.Store.YES));
doc.add(newTextField("field", "wizard the the the the the oz",
Field.Store.NO));
- doc.add(new FloatDocValuesField("final-score", 1.0f));
+ doc.add(newStringField("final-score", "F", Field.Store.YES)); // TODO: change to numeric field
w.addDocument(doc);
doc = new Document();
@@ -120,7 +124,7 @@ public class TestLTRReRankingPipeline extends LuceneTestCase {
// 1 extra token, but wizard and oz are close;
doc.add(newTextField("field", "wizard oz the the the the the the",
Field.Store.NO));
- doc.add(new FloatDocValuesField("final-score", 2.0f));
+ doc.add(newStringField("final-score", "T", Field.Store.YES)); // TODO: change to numeric field
w.addDocument(doc);
final IndexReader r = w.getReader();
@@ -145,7 +149,7 @@ public class TestLTRReRankingPipeline extends LuceneTestCase {
final List<Feature> allFeatures = makeFieldValueFeatures(new int[] {0, 1,
2, 3, 4, 5, 6, 7, 8, 9}, "final-score");
final LTRScoringModel ltrScoringModel = TestLinearModel.createLinearModel("test",
- features, norms, "test", allFeatures, null);
+ features, norms, "test", allFeatures, TestLinearModel.makeFeatureWeights(features));
final LTRRescorer rescorer = new LTRRescorer(new LTRScoringQuery(ltrScoringModel));
hits = rescorer.rescore(searcher, hits, 2);
@@ -221,7 +225,7 @@ public class TestLTRReRankingPipeline extends LuceneTestCase {
final List<Feature> allFeatures = makeFieldValueFeatures(new int[] {0, 1,
2, 3, 4, 5, 6, 7, 8, 9}, "final-score");
final LTRScoringModel ltrScoringModel = TestLinearModel.createLinearModel("test",
- features, norms, "test", allFeatures, null);
+ features, norms, "test", allFeatures, TestLinearModel.makeFeatureWeights(features));
final LTRRescorer rescorer = new LTRRescorer(new LTRScoringQuery(ltrScoringModel));
[2/2] lucene-solr:branch_7x: SOLR-10174,
SOLR-11134: @AwaitsFix instead of @Ignore for
TestLTRReRankingPipeline.testDifferentTopN
Posted by cp...@apache.org.
SOLR-10174, SOLR-11134: @AwaitsFix instead of @Ignore for TestLTRReRankingPipeline.testDifferentTopN
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/5be12589
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/5be12589
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/5be12589
Branch: refs/heads/branch_7x
Commit: 5be1258965c069b8c89c9a04b1f92fd218e027fe
Parents: 2f8b049
Author: Christine Poerschke <cp...@apache.org>
Authored: Fri Jul 21 15:43:01 2017 +0100
Committer: Christine Poerschke <cp...@apache.org>
Committed: Fri Jul 21 16:03:42 2017 +0100
----------------------------------------------------------------------
.../src/test/org/apache/solr/ltr/TestLTRReRankingPipeline.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5be12589/solr/contrib/ltr/src/test/org/apache/solr/ltr/TestLTRReRankingPipeline.java
----------------------------------------------------------------------
diff --git a/solr/contrib/ltr/src/test/org/apache/solr/ltr/TestLTRReRankingPipeline.java b/solr/contrib/ltr/src/test/org/apache/solr/ltr/TestLTRReRankingPipeline.java
index ed7be63..081245f 100644
--- a/solr/contrib/ltr/src/test/org/apache/solr/ltr/TestLTRReRankingPipeline.java
+++ b/solr/contrib/ltr/src/test/org/apache/solr/ltr/TestLTRReRankingPipeline.java
@@ -48,7 +48,6 @@ import org.apache.solr.ltr.model.LTRScoringModel;
import org.apache.solr.ltr.model.TestLinearModel;
import org.apache.solr.ltr.norm.IdentityNormalizer;
import org.apache.solr.ltr.norm.Normalizer;
-import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -163,7 +162,7 @@ public class TestLTRReRankingPipeline extends LuceneTestCase {
}
- @Ignore
+ @AwaitsFix(bugUrl = "https://issues.apache.org/jira/browse/SOLR-11134")
@Test
public void testDifferentTopN() throws IOException {
final Directory dir = newDirectory();