0
0
Fork 0

added test for nested conjunction searches

This commit is contained in:
Marty Schoch 2014-04-24 16:22:12 -06:00
parent b78b1988a7
commit b6ba2efdef
1 changed files with 48 additions and 0 deletions

View File

@ -150,6 +150,54 @@ func TestTermConjunctionSearch(t *testing.T) {
},
},
},
{
index: twoDocIndex,
query: &TermConjunctionQuery{
Terms: []Query{
&TermConjunctionQuery{
Terms: []Query{
&TermQuery{
Term: "beer",
Field: "desc",
BoostVal: 1.0,
Explain: true,
},
&TermQuery{
Term: "mister",
Field: "title",
BoostVal: 5.0,
Explain: true,
},
},
Explain: true,
},
&TermConjunctionQuery{
Terms: []Query{
&TermQuery{
Term: "couchbase",
Field: "street",
BoostVal: 1.0,
Explain: true,
},
&TermQuery{
Term: "mister",
Field: "title",
BoostVal: 5.0,
Explain: true,
},
},
Explain: true,
},
},
Explain: true,
},
results: []*DocumentMatch{
&DocumentMatch{
ID: "2",
Score: 2.7073553504667243,
},
},
},
}
for testIndex, test := range tests {