use of com.yahoo.prelude.query.OrItem in project vespa by vespa-engine.
the class ParseTestCase method testOrAndSomeTermsFilterAndAnAnd.
// This is an ugly parse tree, but it's at least reasonable
@Test
public void testOrAndSomeTermsFilterAndAnAnd() {
AndItem root = (AndItem) tester.assertParsed("AND (RANK d |c |a |b |e) (OR |e |f)", "d", "c (a b) e +(e f)", Query.Type.ALL);
// AND
assertFalse(root.isFilter());
// RANK
assertFalse(root.getItem(0).isFilter());
// d
assertFalse(((RankItem) root.getItem(0)).getItem(0).isFilter());
// c
assertTrue(((RankItem) root.getItem(0)).getItem(1).isFilter());
// a
assertTrue(((RankItem) root.getItem(0)).getItem(2).isFilter());
// b
assertTrue(((RankItem) root.getItem(0)).getItem(3).isFilter());
// e
assertTrue(((RankItem) root.getItem(0)).getItem(4).isFilter());
// OR
assertFalse(root.getItem(1).isFilter());
// e
assertTrue(((OrItem) root.getItem(1)).getItem(0).isFilter());
// f
assertTrue(((OrItem) root.getItem(1)).getItem(1).isFilter());
}
use of com.yahoo.prelude.query.OrItem in project vespa by vespa-engine.
the class ParseTestCase method testPrefixAndWordTerms.
@Test
public void testPrefixAndWordTerms() {
Item root = tester.assertParsed("OR foo prefix* bar", "foo prefix* bar", Query.Type.ANY);
assertTrue(((OrItem) root).getItem(1) instanceof PrefixItem);
}
Aggregations