use of com.yahoo.prelude.query.WordItem in project vespa by vespa-engine.
the class QueryLanguageTestCase method testWord.
@Test
public void testWord() {
WordItem w = new WordItem("test");
assertEquals("test", w.toString());
}
use of com.yahoo.prelude.query.WordItem in project vespa by vespa-engine.
the class CollapsePhraseSearcherTestCase method testPositive2.
@Test
public void testPositive2() {
AndItem root = new AndItem();
root.addItem(new WordItem("a"));
CompositeItem embedded = new AndItem();
embedded.addItem(new WordItem("bcd"));
CompositeItem phrase = new PhraseItem();
phrase.addItem(new WordItem("def"));
embedded.addItem(phrase);
root.addItem(embedded);
root.addItem(new WordItem("e"));
assertEquals("AND a (AND bcd def) e", transformQuery(root));
}
use of com.yahoo.prelude.query.WordItem in project vespa by vespa-engine.
the class CollapsePhraseSearcherTestCase method testNegative3.
@Test
public void testNegative3() {
AndItem root = new AndItem();
root.addItem(new WordItem("a"));
CompositeItem embedded = new AndItem();
embedded.addItem(new WordItem("bcd"));
CompositeItem phrase = new PhraseItem();
phrase.addItem(new WordItem("def"));
phrase.addItem(new WordItem("ghi"));
embedded.addItem(phrase);
root.addItem(embedded);
root.addItem(new WordItem("e"));
assertEquals("AND a (AND bcd \"def ghi\") e", transformQuery(root));
}
use of com.yahoo.prelude.query.WordItem in project vespa by vespa-engine.
the class CollapsePhraseSearcherTestCase method testPositive1.
@Test
public void testPositive1() {
AndItem root = new AndItem();
root.addItem(new WordItem("a"));
PhraseItem embedded = new PhraseItem();
embedded.addItem(new WordItem("bcd"));
root.addItem(embedded);
root.addItem(new WordItem("e"));
assertEquals("AND a bcd e", transformQuery(root));
}
use of com.yahoo.prelude.query.WordItem in project vespa by vespa-engine.
the class CollapsePhraseSearcherTestCase method testSimplePositive.
@Test
public void testSimplePositive() {
PhraseItem root = new PhraseItem();
root.addItem(new WordItem("abc"));
assertEquals("abc", transformQuery(root));
}
Aggregations