use of com.yahoo.prelude.query.OrItem in project vespa by vespa-engine.
the class ParseTestCase method testIndexSuffixExtraSpace.
@Test
public void testIndexSuffixExtraSpace() {
Item root = tester.assertParsed("OR foo suffix", "foo:* suffix", Query.Type.ANY);
assertTrue(((OrItem) root).getItem(0) instanceof WordItem);
assertTrue(((OrItem) root).getItem(1) instanceof WordItem);
}
use of com.yahoo.prelude.query.OrItem in project vespa by vespa-engine.
the class ParseTestCase method testSuffixAndWordTerms.
@Test
public void testSuffixAndWordTerms() {
Item root = tester.assertParsed("OR foo *suffix bar", "foo *suffix bar", Query.Type.ANY);
assertTrue(((OrItem) root).getItem(1) instanceof SuffixItem);
}
use of com.yahoo.prelude.query.OrItem in project vespa by vespa-engine.
the class PhrasingSearcherTestCase method testNoFileNoChange.
@Test
public void testNoFileNoChange() {
Searcher searcher = new PhrasingSearcher("");
Query query = new Query();
AndItem andItem = new AndItem();
andItem.addItem(new WordItem("no", "anindex"));
andItem.addItem(new WordItem("such", "anindex"));
andItem.addItem(new WordItem("phrase", "indexo"));
OrItem orItem = new OrItem();
orItem.addItem(new WordItem("habla"));
orItem.addItem(new WordItem("babla"));
orItem.addItem(new WordItem("habla"));
andItem.addItem(orItem);
query.getModel().getQueryTree().setRoot(andItem);
new Execution(searcher, Execution.Context.createContextStub()).search(query);
assertEquals("AND anindex:no anindex:such indexo:phrase (OR habla babla habla)", query.getModel().getQueryTree().getRoot().toString());
}
use of com.yahoo.prelude.query.OrItem in project vespa by vespa-engine.
the class ParseTestCase method testIndexSubstringExtraSpace.
@Test
public void testIndexSubstringExtraSpace() {
Item root = tester.assertParsed("OR foo substring*", "foo:* substring*", Query.Type.ANY);
assertTrue(((OrItem) root).getItem(0) instanceof WordItem);
assertTrue(((OrItem) root).getItem(1) instanceof PrefixItem);
}
use of com.yahoo.prelude.query.OrItem in project vespa by vespa-engine.
the class ParseTestCase method testIndexSubstringExtraSpace2.
@Test
public void testIndexSubstringExtraSpace2() {
Item root = tester.assertParsed("OR foo substring", "foo:* substring *", Query.Type.ANY);
assertTrue(((OrItem) root).getItem(0) instanceof WordItem);
assertTrue(((OrItem) root).getItem(1) instanceof WordItem);
}
Aggregations