mirror of https://github.com/apache/lucene.git
SOLR-8542: reduce direct solrconfig-ltr.xml references in solr/contrib/ltr tests
This commit is contained in:
parent
f7ea2ae85d
commit
ac3f1bb339
|
@ -26,7 +26,7 @@ public class TestLTRQParserExplain extends TestRerankBase {
|
|||
|
||||
@BeforeClass
|
||||
public static void setup() throws Exception {
|
||||
setuptest();
|
||||
setuptest(true);
|
||||
loadFeatures("features-store-test-model.json");
|
||||
}
|
||||
|
||||
|
|
|
@ -26,9 +26,7 @@ public class TestLTRQParserPlugin extends TestRerankBase {
|
|||
|
||||
@BeforeClass
|
||||
public static void before() throws Exception {
|
||||
setuptest("solrconfig-ltr.xml", "schema.xml");
|
||||
// store = getModelStore();
|
||||
bulkIndex();
|
||||
setuptest(true);
|
||||
|
||||
loadFeatures("features-linear.json");
|
||||
loadModels("linear-model.json");
|
||||
|
@ -37,7 +35,6 @@ public class TestLTRQParserPlugin extends TestRerankBase {
|
|||
@AfterClass
|
||||
public static void after() throws Exception {
|
||||
aftertest();
|
||||
// store.clear();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -28,7 +28,7 @@ public class TestLTRWithFacet extends TestRerankBase {
|
|||
|
||||
@BeforeClass
|
||||
public static void before() throws Exception {
|
||||
setuptest("solrconfig-ltr.xml", "schema.xml");
|
||||
setuptest(false);
|
||||
|
||||
assertU(adoc("id", "1", "title", "a1", "description", "E", "popularity",
|
||||
"1"));
|
||||
|
|
|
@ -28,7 +28,7 @@ public class TestLTRWithSort extends TestRerankBase {
|
|||
|
||||
@BeforeClass
|
||||
public static void before() throws Exception {
|
||||
setuptest("solrconfig-ltr.xml", "schema.xml");
|
||||
setuptest(false);
|
||||
assertU(adoc("id", "1", "title", "a1", "description", "E", "popularity",
|
||||
"1"));
|
||||
assertU(adoc("id", "2", "title", "a1 b1", "description",
|
||||
|
|
|
@ -75,14 +75,14 @@ public class TestRerankBase extends RestTestBase {
|
|||
protected static File fstorefile = null;
|
||||
protected static File mstorefile = null;
|
||||
|
||||
public static void setuptest() throws Exception {
|
||||
protected static void setuptest(boolean bulkIndex) throws Exception {
|
||||
setuptest("solrconfig-ltr.xml", "schema.xml");
|
||||
bulkIndex();
|
||||
if (bulkIndex) bulkIndex();
|
||||
}
|
||||
|
||||
public static void setupPersistenttest() throws Exception {
|
||||
protected static void setupPersistenttest(boolean bulkIndex) throws Exception {
|
||||
setupPersistentTest("solrconfig-ltr.xml", "schema.xml");
|
||||
bulkIndex();
|
||||
if (bulkIndex) bulkIndex();
|
||||
}
|
||||
|
||||
public static ManagedFeatureStore getManagedFeatureStore() {
|
||||
|
@ -178,8 +178,6 @@ public class TestRerankBase extends RestTestBase {
|
|||
FileUtils.deleteDirectory(tmpSolrHome);
|
||||
System.clearProperty("managed.schema.mutable");
|
||||
// System.clearProperty("enable.update.log");
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static void makeRestTestHarnessNull() {
|
||||
|
|
|
@ -104,7 +104,7 @@ public class TestSelectiveWeightCreation extends TestRerankBase {
|
|||
|
||||
@BeforeClass
|
||||
public static void before() throws Exception {
|
||||
setuptest("solrconfig-ltr.xml", "schema.xml");
|
||||
setuptest(false);
|
||||
|
||||
assertU(adoc("id", "1", "title", "w1 w3", "description", "w1", "popularity",
|
||||
"1"));
|
||||
|
|
|
@ -27,7 +27,7 @@ public class TestEdisMaxSolrFeature extends TestRerankBase {
|
|||
|
||||
@BeforeClass
|
||||
public static void before() throws Exception {
|
||||
setuptest("solrconfig-ltr.xml", "schema.xml");
|
||||
setuptest(false);
|
||||
|
||||
assertU(adoc("id", "1", "title", "w1", "description", "w1", "popularity",
|
||||
"1"));
|
||||
|
|
|
@ -27,7 +27,7 @@ public class TestExternalFeatures extends TestRerankBase {
|
|||
|
||||
@BeforeClass
|
||||
public static void before() throws Exception {
|
||||
setuptest("solrconfig-ltr.xml", "schema.xml");
|
||||
setuptest(false);
|
||||
|
||||
assertU(adoc("id", "1", "title", "w1", "description", "w1", "popularity",
|
||||
"1"));
|
||||
|
|
|
@ -27,7 +27,7 @@ public class TestExternalValueFeatures extends TestRerankBase {
|
|||
|
||||
@BeforeClass
|
||||
public static void before() throws Exception {
|
||||
setuptest("solrconfig-ltr.xml", "schema.xml");
|
||||
setuptest(false);
|
||||
|
||||
assertU(adoc("id", "1", "title", "w1", "description", "w1", "popularity",
|
||||
"1"));
|
||||
|
|
|
@ -29,7 +29,7 @@ public class TestFeatureLogging extends TestRerankBase {
|
|||
|
||||
@BeforeClass
|
||||
public static void setup() throws Exception {
|
||||
setuptest();
|
||||
setuptest(true);
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
|
|
|
@ -29,7 +29,7 @@ public class TestFeatureLtrScoringModel extends TestRerankBase {
|
|||
|
||||
@BeforeClass
|
||||
public static void setup() throws Exception {
|
||||
setuptest();
|
||||
setuptest(true);
|
||||
store = getManagedFeatureStore();
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ public class TestFeatureStore extends TestRerankBase {
|
|||
|
||||
@BeforeClass
|
||||
public static void setup() throws Exception {
|
||||
setuptest();
|
||||
setuptest(true);
|
||||
fstore = getManagedFeatureStore();
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ public class TestFieldLengthFeature extends TestRerankBase {
|
|||
|
||||
@BeforeClass
|
||||
public static void before() throws Exception {
|
||||
setuptest("solrconfig-ltr.xml", "schema.xml");
|
||||
setuptest(false);
|
||||
|
||||
assertU(adoc("id", "1", "title", "w1", "description", "w1"));
|
||||
assertU(adoc("id", "2", "title", "w2 2asd asdd didid", "description",
|
||||
|
|
|
@ -30,7 +30,7 @@ public class TestFieldValueFeature extends TestRerankBase {
|
|||
|
||||
@BeforeClass
|
||||
public static void before() throws Exception {
|
||||
setuptest("solrconfig-ltr.xml", "schema.xml");
|
||||
setuptest(false);
|
||||
|
||||
assertU(adoc("id", "1", "title", "w1", "description", "w1", "popularity",
|
||||
"1","isTrendy","true"));
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.junit.Test;
|
|||
public class TestFilterSolrFeature extends TestRerankBase {
|
||||
@BeforeClass
|
||||
public static void before() throws Exception {
|
||||
setuptest("solrconfig-ltr.xml", "schema.xml");
|
||||
setuptest(false);
|
||||
|
||||
assertU(adoc("id", "1", "title", "w1", "description", "w1", "popularity",
|
||||
"1"));
|
||||
|
|
|
@ -33,7 +33,7 @@ public class TestNoMatchSolrFeature extends TestRerankBase {
|
|||
|
||||
@BeforeClass
|
||||
public static void before() throws Exception {
|
||||
setuptest("solrconfig-ltr.xml", "schema.xml");
|
||||
setuptest(false);
|
||||
|
||||
assertU(adoc("id", "1", "title", "w1", "description", "w1", "popularity",
|
||||
"1"));
|
||||
|
|
|
@ -32,7 +32,7 @@ public class TestOriginalScoreFeature extends TestRerankBase {
|
|||
|
||||
@BeforeClass
|
||||
public static void before() throws Exception {
|
||||
setuptest("solrconfig-ltr.xml", "schema.xml");
|
||||
setuptest(false);
|
||||
|
||||
assertU(adoc("id", "1", "title", "w1"));
|
||||
assertU(adoc("id", "2", "title", "w2"));
|
||||
|
|
|
@ -28,7 +28,7 @@ public class TestRankingFeature extends TestRerankBase {
|
|||
|
||||
@BeforeClass
|
||||
public static void before() throws Exception {
|
||||
setuptest("solrconfig-ltr.xml", "schema.xml");
|
||||
setuptest(false);
|
||||
|
||||
assertU(adoc("id", "1", "title", "w1", "description", "w1", "popularity",
|
||||
"1"));
|
||||
|
|
|
@ -27,7 +27,7 @@ public class TestUserTermScoreWithQ extends TestRerankBase {
|
|||
|
||||
@BeforeClass
|
||||
public static void before() throws Exception {
|
||||
setuptest("solrconfig-ltr.xml", "schema.xml");
|
||||
setuptest(false);
|
||||
|
||||
assertU(adoc("id", "1", "title", "w1", "description", "w1", "popularity",
|
||||
"1"));
|
||||
|
|
|
@ -27,7 +27,7 @@ public class TestUserTermScorerQuery extends TestRerankBase {
|
|||
|
||||
@BeforeClass
|
||||
public static void before() throws Exception {
|
||||
setuptest("solrconfig-ltr.xml", "schema.xml");
|
||||
setuptest(false);
|
||||
|
||||
assertU(adoc("id", "1", "title", "w1", "description", "w1", "popularity",
|
||||
"1"));
|
||||
|
|
|
@ -27,7 +27,7 @@ public class TestUserTermScorereQDF extends TestRerankBase {
|
|||
|
||||
@BeforeClass
|
||||
public static void before() throws Exception {
|
||||
setuptest("solrconfig-ltr.xml", "schema.xml");
|
||||
setuptest(false);
|
||||
|
||||
assertU(adoc("id", "1", "title", "w1", "description", "w1", "popularity",
|
||||
"1"));
|
||||
|
|
|
@ -27,7 +27,7 @@ public class TestValueFeature extends TestRerankBase {
|
|||
|
||||
@BeforeClass
|
||||
public static void before() throws Exception {
|
||||
setuptest("solrconfig-ltr.xml", "schema.xml");
|
||||
setuptest(false);
|
||||
|
||||
assertU(adoc("id", "1", "title", "w1"));
|
||||
assertU(adoc("id", "2", "title", "w2"));
|
||||
|
|
|
@ -50,7 +50,7 @@ public class TestLinearModel extends TestRerankBase {
|
|||
|
||||
@BeforeClass
|
||||
public static void setup() throws Exception {
|
||||
setuptest();
|
||||
setuptest(true);
|
||||
// loadFeatures("features-store-test-model.json");
|
||||
store = getManagedModelStore();
|
||||
fstore = getManagedFeatureStore().getFeatureStore("test");
|
||||
|
|
|
@ -30,7 +30,7 @@ public class TestMultipleAdditiveTreesModel extends TestRerankBase {
|
|||
|
||||
@BeforeClass
|
||||
public static void before() throws Exception {
|
||||
setuptest("solrconfig-ltr.xml", "schema.xml");
|
||||
setuptest(false);
|
||||
|
||||
assertU(adoc("id", "1", "title", "w1", "description", "w1", "popularity","1"));
|
||||
assertU(adoc("id", "2", "title", "w2", "description", "w2", "popularity","2"));
|
||||
|
|
|
@ -34,7 +34,7 @@ public class TestModelManager extends TestRerankBase {
|
|||
|
||||
@BeforeClass
|
||||
public static void init() throws Exception {
|
||||
setuptest();
|
||||
setuptest(true);
|
||||
}
|
||||
|
||||
@Before
|
||||
|
|
|
@ -31,7 +31,7 @@ public class TestModelManagerPersistence extends TestRerankBase {
|
|||
|
||||
@Before
|
||||
public void init() throws Exception {
|
||||
setupPersistenttest();
|
||||
setupPersistenttest(true);
|
||||
}
|
||||
|
||||
// executed first
|
||||
|
|
Loading…
Reference in New Issue