TestSimpleExplanationspublic class TestSimpleExplanations extends TestExplanations TestExplanations subclass focusing on basic query types |
Methods Summary |
---|
public void | testBQ1()
qtest("+w1 +w2", new int[] { 0,1,2,3 });
| public void | testBQ10()
qtest("+w1 +(qq (-xx w2) -(+w3 +w4))", new int[] { 1 });
| public void | testBQ11()
qtest("w1 w2^1000.0", new int[] { 0,1,2,3 });
| public void | testBQ14()
BooleanQuery q = new BooleanQuery(true);
q.add(qp.parse("QQQQQ"), BooleanClause.Occur.SHOULD);
q.add(qp.parse("w1"), BooleanClause.Occur.SHOULD);
qtest(q, new int[] { 0,1,2,3 });
| public void | testBQ15()
BooleanQuery q = new BooleanQuery(true);
q.add(qp.parse("QQQQQ"), BooleanClause.Occur.MUST_NOT);
q.add(qp.parse("w1"), BooleanClause.Occur.SHOULD);
qtest(q, new int[] { 0,1,2,3 });
| public void | testBQ16()
BooleanQuery q = new BooleanQuery(true);
q.add(qp.parse("QQQQQ"), BooleanClause.Occur.SHOULD);
q.add(qp.parse("w1 -xx"), BooleanClause.Occur.SHOULD);
qtest(q, new int[] { 0,1 });
| public void | testBQ17()
BooleanQuery q = new BooleanQuery(true);
q.add(qp.parse("w2"), BooleanClause.Occur.SHOULD);
q.add(qp.parse("w1 -xx"), BooleanClause.Occur.SHOULD);
qtest(q, new int[] { 0,1,2,3 });
| public void | testBQ19()
qtest("-yy w3", new int[] { 0,1 });
| public void | testBQ2()
qtest("+yy +w3", new int[] { 2,3 });
| public void | testBQ20()
BooleanQuery q = new BooleanQuery();
q.setMinimumNumberShouldMatch(2);
q.add(qp.parse("QQQQQ"), BooleanClause.Occur.SHOULD);
q.add(qp.parse("yy"), BooleanClause.Occur.SHOULD);
q.add(qp.parse("zz"), BooleanClause.Occur.SHOULD);
q.add(qp.parse("w5"), BooleanClause.Occur.SHOULD);
q.add(qp.parse("w4"), BooleanClause.Occur.SHOULD);
qtest(q, new int[] { 0,3 });
| public void | testBQ3()
qtest("yy +w3", new int[] { 0,1,2,3 });
| public void | testBQ4()
qtest("w1 (-xx w2)", new int[] { 0,1,2,3 });
| public void | testBQ5()
qtest("w1 (+qq w2)", new int[] { 0,1,2,3 });
| public void | testBQ6()
qtest("w1 -(-qq w5)", new int[] { 1,2,3 });
| public void | testBQ7()
qtest("+w1 +(qq (xx -w2) (+w3 +w4))", new int[] { 0 });
| public void | testBQ8()
qtest("+w1 (qq (xx -w2) (+w3 +w4))", new int[] { 0,1,2,3 });
| public void | testBQ9()
qtest("+w1 (qq (-xx w2) -(+w3 +w4))", new int[] { 0,1,2,3 });
| public void | testCSQ1()
Query q = new ConstantScoreQuery(new ItemizedFilter(new int[] {0,1,2,3}));
qtest(q, new int[] {0,1,2,3});
| public void | testCSQ2()
Query q = new ConstantScoreQuery(new ItemizedFilter(new int[] {1,3}));
qtest(q, new int[] {1,3});
| public void | testCSQ3()
Query q = new ConstantScoreQuery(new ItemizedFilter(new int[] {0,2}));
q.setBoost(1000);
qtest(q, new int[] {0,2});
| public void | testDMQ1()
DisjunctionMaxQuery q = new DisjunctionMaxQuery(0.0f);
q.add(qp.parse("w1"));
q.add(qp.parse("w5"));
qtest(q, new int[] { 0,1,2,3 });
| public void | testDMQ2()
DisjunctionMaxQuery q = new DisjunctionMaxQuery(0.5f);
q.add(qp.parse("w1"));
q.add(qp.parse("w5"));
qtest(q, new int[] { 0,1,2,3 });
| public void | testDMQ3()
DisjunctionMaxQuery q = new DisjunctionMaxQuery(0.5f);
q.add(qp.parse("QQ"));
q.add(qp.parse("w5"));
qtest(q, new int[] { 0 });
| public void | testDMQ4()
DisjunctionMaxQuery q = new DisjunctionMaxQuery(0.5f);
q.add(qp.parse("QQ"));
q.add(qp.parse("xx"));
qtest(q, new int[] { 2,3 });
| public void | testDMQ5()
DisjunctionMaxQuery q = new DisjunctionMaxQuery(0.5f);
q.add(qp.parse("yy -QQ"));
q.add(qp.parse("xx"));
qtest(q, new int[] { 2,3 });
| public void | testDMQ6()
DisjunctionMaxQuery q = new DisjunctionMaxQuery(0.5f);
q.add(qp.parse("-yy w3"));
q.add(qp.parse("xx"));
qtest(q, new int[] { 0,1,2,3 });
| public void | testDMQ7()
DisjunctionMaxQuery q = new DisjunctionMaxQuery(0.5f);
q.add(qp.parse("-yy w3"));
q.add(qp.parse("w2"));
qtest(q, new int[] { 0,1,2,3 });
| public void | testDMQ8()
DisjunctionMaxQuery q = new DisjunctionMaxQuery(0.5f);
q.add(qp.parse("yy w5^100"));
q.add(qp.parse("xx^100000"));
qtest(q, new int[] { 0,2,3 });
| public void | testDMQ9()
DisjunctionMaxQuery q = new DisjunctionMaxQuery(0.5f);
q.add(qp.parse("yy w5^100"));
q.add(qp.parse("xx^0"));
qtest(q, new int[] { 0,2,3 });
| public void | testFQ1()
qtest(new FilteredQuery(qp.parse("w1"),
new ItemizedFilter(new int[] {0,1,2,3})),
new int[] {0,1,2,3});
| public void | testFQ2()
qtest(new FilteredQuery(qp.parse("w1"),
new ItemizedFilter(new int[] {0,2,3})),
new int[] {0,2,3});
| public void | testFQ3()
qtest(new FilteredQuery(qp.parse("xx"),
new ItemizedFilter(new int[] {1,3})),
new int[] {3});
| public void | testFQ4()
qtest(new FilteredQuery(qp.parse("xx^1000"),
new ItemizedFilter(new int[] {1,3})),
new int[] {3});
| public void | testFQ6()
Query q = new FilteredQuery(qp.parse("xx"),
new ItemizedFilter(new int[] {1,3}));
q.setBoost(1000);
qtest(q, new int[] {3});
| public void | testFQ7()
Query q = new FilteredQuery(qp.parse("xx"),
new ItemizedFilter(new int[] {1,3}));
q.setBoost(0);
qtest(q, new int[] {3});
| public void | testMA1()
qtest(new MatchAllDocsQuery(), new int[] { 0,1,2,3 });
| public void | testMA2()
Query q=new MatchAllDocsQuery();
q.setBoost(1000);
qtest(q, new int[] { 0,1,2,3 });
| public void | testMPQ1()
MultiPhraseQuery q = new MultiPhraseQuery();
q.add(ta(new String[] {"w1"}));
q.add(ta(new String[] {"w2","w3", "xx"}));
qtest(q, new int[] { 0,1,2,3 });
| public void | testMPQ2()
MultiPhraseQuery q = new MultiPhraseQuery();
q.add(ta(new String[] {"w1"}));
q.add(ta(new String[] {"w2","w3"}));
qtest(q, new int[] { 0,1,3 });
| public void | testMPQ3()
MultiPhraseQuery q = new MultiPhraseQuery();
q.add(ta(new String[] {"w1","xx"}));
q.add(ta(new String[] {"w2","w3"}));
qtest(q, new int[] { 0,1,2,3 });
| public void | testMPQ4()
MultiPhraseQuery q = new MultiPhraseQuery();
q.add(ta(new String[] {"w1"}));
q.add(ta(new String[] {"w2"}));
qtest(q, new int[] { 0 });
| public void | testMPQ5()
MultiPhraseQuery q = new MultiPhraseQuery();
q.add(ta(new String[] {"w1"}));
q.add(ta(new String[] {"w2"}));
q.setSlop(1);
qtest(q, new int[] { 0,1,2 });
| public void | testMPQ6()
MultiPhraseQuery q = new MultiPhraseQuery();
q.add(ta(new String[] {"w1","w3"}));
q.add(ta(new String[] {"w2"}));
q.setSlop(1);
qtest(q, new int[] { 0,1,2,3 });
| public void | testP1()
qtest("\"w1 w2\"", new int[] { 0 });
| public void | testP2()
qtest("\"w1 w3\"", new int[] { 1,3 });
| public void | testP3()
qtest("\"w1 w2\"~1", new int[] { 0,1,2 });
| public void | testP4()
qtest("\"w2 w3\"~1", new int[] { 0,1,2,3 });
| public void | testP5()
qtest("\"w3 w2\"~1", new int[] { 1,3 });
| public void | testP6()
qtest("\"w3 w2\"~2", new int[] { 0,1,3 });
| public void | testP7()
qtest("\"w3 w2\"~3", new int[] { 0,1,2,3 });
| public void | testT1()
qtest("w1", new int[] { 0,1,2,3 });
| public void | testT2()
qtest("w1^1000", new int[] { 0,1,2,3 });
|
|