0
0
Fork 0

added a nested disjunction test

This commit is contained in:
Marty Schoch 2014-04-25 10:33:42 -06:00
parent ce87f46403
commit 4ed5cda99c
1 changed files with 48 additions and 0 deletions

View File

@ -52,6 +52,54 @@ func TestTermDisjunctionSearch(t *testing.T) {
},
},
},
// test a nested disjunction
{
index: twoDocIndex,
query: &TermDisjunctionQuery{
Terms: []Query{
&TermQuery{
Term: "ravi",
Field: "name",
BoostVal: 1.0,
Explain: true,
},
&TermDisjunctionQuery{
Terms: []Query{
&TermQuery{
Term: "marty",
Field: "name",
BoostVal: 1.0,
Explain: true,
},
&TermQuery{
Term: "dustin",
Field: "name",
BoostVal: 1.0,
Explain: true,
},
},
Explain: true,
Min: 0,
},
},
Explain: true,
Min: 0,
},
results: []*DocumentMatch{
&DocumentMatch{
ID: "1",
Score: 0.33875554280828685,
},
&DocumentMatch{
ID: "3",
Score: 0.33875554280828685,
},
&DocumentMatch{
ID: "4",
Score: 0.5531854849465642,
},
},
},
}
for testIndex, test := range tests {