@Test
public void testDisMaxBuilder() throws Exception {
IndexQueryParserService queryParser = queryParser();
Query parsedQuery = queryParser.parse(disMaxQuery().boost(1.2f).tieBreaker(0.7f).add(termQuery("name.first", "first")).add(termQuery("name.last", "last"))).query();
assertThat(parsedQuery, instanceOf(DisjunctionMaxQuery.class));
DisjunctionMaxQuery disjunctionMaxQuery = (DisjunctionMaxQuery) parsedQuery;
assertThat((double) disjunctionMaxQuery.getBoost(), closeTo(1.2, 0.01));
List<Query> disjuncts = disjunctionMaxQuery.getDisjuncts();
assertThat(disjuncts.size(), equalTo(2));
Query firstQ = disjuncts.get(0);
assertThat(firstQ, instanceOf(TermQuery.class));
assertThat(((TermQuery) firstQ).getTerm(), equalTo(new Term("name.first", "first")));