mirror of https://github.com/apache/lucene.git
add nested clauses for .equals test
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@161998 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
db095e45e5
commit
1bda4aff94
|
@ -24,10 +24,18 @@ public class TestBooleanQuery extends TestCase {
|
||||||
BooleanQuery bq1 = new BooleanQuery();
|
BooleanQuery bq1 = new BooleanQuery();
|
||||||
bq1.add(new TermQuery(new Term("field", "value1")), BooleanClause.Occur.SHOULD);
|
bq1.add(new TermQuery(new Term("field", "value1")), BooleanClause.Occur.SHOULD);
|
||||||
bq1.add(new TermQuery(new Term("field", "value2")), BooleanClause.Occur.SHOULD);
|
bq1.add(new TermQuery(new Term("field", "value2")), BooleanClause.Occur.SHOULD);
|
||||||
|
BooleanQuery nested1 = new BooleanQuery();
|
||||||
|
nested1.add(new TermQuery(new Term("field", "nestedvalue1")), BooleanClause.Occur.SHOULD);
|
||||||
|
nested1.add(new TermQuery(new Term("field", "nestedvalue2")), BooleanClause.Occur.SHOULD);
|
||||||
|
bq1.add(nested1, BooleanClause.Occur.SHOULD);
|
||||||
|
|
||||||
BooleanQuery bq2 = new BooleanQuery();
|
BooleanQuery bq2 = new BooleanQuery();
|
||||||
bq2.add(new TermQuery(new Term("field", "value1")), BooleanClause.Occur.SHOULD);
|
bq2.add(new TermQuery(new Term("field", "value1")), BooleanClause.Occur.SHOULD);
|
||||||
bq2.add(new TermQuery(new Term("field", "value2")), BooleanClause.Occur.SHOULD);
|
bq2.add(new TermQuery(new Term("field", "value2")), BooleanClause.Occur.SHOULD);
|
||||||
|
BooleanQuery nested2 = new BooleanQuery();
|
||||||
|
nested2.add(new TermQuery(new Term("field", "nestedvalue1")), BooleanClause.Occur.SHOULD);
|
||||||
|
nested2.add(new TermQuery(new Term("field", "nestedvalue2")), BooleanClause.Occur.SHOULD);
|
||||||
|
bq2.add(nested2, BooleanClause.Occur.SHOULD);
|
||||||
|
|
||||||
assertEquals(bq1, bq2);
|
assertEquals(bq1, bq2);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue