Search in sources :

Example 1 with PrefixItem

use of com.yahoo.prelude.query.PrefixItem in project vespa by vespa-engine.

the class ParseTestCase method testSinglePrefixTerm.

@Test
public void testSinglePrefixTerm() {
    Item root = tester.assertParsed("prefix*", "prefix*", Query.Type.ANY);
    assertTrue(root instanceof PrefixItem);
}
Also used : CompositeItem(com.yahoo.prelude.query.CompositeItem) PhraseSegmentItem(com.yahoo.prelude.query.PhraseSegmentItem) PrefixItem(com.yahoo.prelude.query.PrefixItem) Item(com.yahoo.prelude.query.Item) SuffixItem(com.yahoo.prelude.query.SuffixItem) IntItem(com.yahoo.prelude.query.IntItem) OrItem(com.yahoo.prelude.query.OrItem) PhraseItem(com.yahoo.prelude.query.PhraseItem) SubstringItem(com.yahoo.prelude.query.SubstringItem) AndItem(com.yahoo.prelude.query.AndItem) RankItem(com.yahoo.prelude.query.RankItem) WordItem(com.yahoo.prelude.query.WordItem) NotItem(com.yahoo.prelude.query.NotItem) PrefixItem(com.yahoo.prelude.query.PrefixItem) Test(org.junit.Test)

Example 2 with PrefixItem

use of com.yahoo.prelude.query.PrefixItem in project vespa by vespa-engine.

the class ParseTestCase method testPrefixWithWeight.

@Test
public void testPrefixWithWeight() {
    Item root = tester.assertParsed("prefix*!200", "prefix*!200", Query.Type.ANY);
    assertTrue(root instanceof PrefixItem);
}
Also used : CompositeItem(com.yahoo.prelude.query.CompositeItem) PhraseSegmentItem(com.yahoo.prelude.query.PhraseSegmentItem) PrefixItem(com.yahoo.prelude.query.PrefixItem) Item(com.yahoo.prelude.query.Item) SuffixItem(com.yahoo.prelude.query.SuffixItem) IntItem(com.yahoo.prelude.query.IntItem) OrItem(com.yahoo.prelude.query.OrItem) PhraseItem(com.yahoo.prelude.query.PhraseItem) SubstringItem(com.yahoo.prelude.query.SubstringItem) AndItem(com.yahoo.prelude.query.AndItem) RankItem(com.yahoo.prelude.query.RankItem) WordItem(com.yahoo.prelude.query.WordItem) NotItem(com.yahoo.prelude.query.NotItem) PrefixItem(com.yahoo.prelude.query.PrefixItem) Test(org.junit.Test)

Example 3 with PrefixItem

use of com.yahoo.prelude.query.PrefixItem in project vespa by vespa-engine.

the class ParseTestCase method testNumberAsPrefix.

@Test
public void testNumberAsPrefix() {
    Item root = tester.assertParsed("89*", "89*", Query.Type.ANY);
    assertTrue(root instanceof PrefixItem);
}
Also used : CompositeItem(com.yahoo.prelude.query.CompositeItem) PhraseSegmentItem(com.yahoo.prelude.query.PhraseSegmentItem) PrefixItem(com.yahoo.prelude.query.PrefixItem) Item(com.yahoo.prelude.query.Item) SuffixItem(com.yahoo.prelude.query.SuffixItem) IntItem(com.yahoo.prelude.query.IntItem) OrItem(com.yahoo.prelude.query.OrItem) PhraseItem(com.yahoo.prelude.query.PhraseItem) SubstringItem(com.yahoo.prelude.query.SubstringItem) AndItem(com.yahoo.prelude.query.AndItem) RankItem(com.yahoo.prelude.query.RankItem) WordItem(com.yahoo.prelude.query.WordItem) NotItem(com.yahoo.prelude.query.NotItem) PrefixItem(com.yahoo.prelude.query.PrefixItem) Test(org.junit.Test)

Example 4 with PrefixItem

use of com.yahoo.prelude.query.PrefixItem 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);
}
Also used : CompositeItem(com.yahoo.prelude.query.CompositeItem) PhraseSegmentItem(com.yahoo.prelude.query.PhraseSegmentItem) PrefixItem(com.yahoo.prelude.query.PrefixItem) Item(com.yahoo.prelude.query.Item) SuffixItem(com.yahoo.prelude.query.SuffixItem) IntItem(com.yahoo.prelude.query.IntItem) OrItem(com.yahoo.prelude.query.OrItem) PhraseItem(com.yahoo.prelude.query.PhraseItem) SubstringItem(com.yahoo.prelude.query.SubstringItem) AndItem(com.yahoo.prelude.query.AndItem) RankItem(com.yahoo.prelude.query.RankItem) WordItem(com.yahoo.prelude.query.WordItem) NotItem(com.yahoo.prelude.query.NotItem) WordItem(com.yahoo.prelude.query.WordItem) PrefixItem(com.yahoo.prelude.query.PrefixItem) OrItem(com.yahoo.prelude.query.OrItem) Test(org.junit.Test)

Example 5 with PrefixItem

use of com.yahoo.prelude.query.PrefixItem in project vespa by vespa-engine.

the class ParseTestCase method testPrefixExtraStar.

/**
 * Extra star is ignored
 */
@Test
public void testPrefixExtraStar() {
    Item root = tester.assertParsed("prefix*", "prefix**", Query.Type.ANY);
    assertTrue(root instanceof PrefixItem);
}
Also used : CompositeItem(com.yahoo.prelude.query.CompositeItem) PhraseSegmentItem(com.yahoo.prelude.query.PhraseSegmentItem) PrefixItem(com.yahoo.prelude.query.PrefixItem) Item(com.yahoo.prelude.query.Item) SuffixItem(com.yahoo.prelude.query.SuffixItem) IntItem(com.yahoo.prelude.query.IntItem) OrItem(com.yahoo.prelude.query.OrItem) PhraseItem(com.yahoo.prelude.query.PhraseItem) SubstringItem(com.yahoo.prelude.query.SubstringItem) AndItem(com.yahoo.prelude.query.AndItem) RankItem(com.yahoo.prelude.query.RankItem) WordItem(com.yahoo.prelude.query.WordItem) NotItem(com.yahoo.prelude.query.NotItem) PrefixItem(com.yahoo.prelude.query.PrefixItem) Test(org.junit.Test)

Aggregations

AndItem (com.yahoo.prelude.query.AndItem)8 CompositeItem (com.yahoo.prelude.query.CompositeItem)8 IntItem (com.yahoo.prelude.query.IntItem)8 Item (com.yahoo.prelude.query.Item)8 NotItem (com.yahoo.prelude.query.NotItem)8 OrItem (com.yahoo.prelude.query.OrItem)8 PhraseItem (com.yahoo.prelude.query.PhraseItem)8 PhraseSegmentItem (com.yahoo.prelude.query.PhraseSegmentItem)8 PrefixItem (com.yahoo.prelude.query.PrefixItem)8 RankItem (com.yahoo.prelude.query.RankItem)8 SubstringItem (com.yahoo.prelude.query.SubstringItem)8 SuffixItem (com.yahoo.prelude.query.SuffixItem)8 WordItem (com.yahoo.prelude.query.WordItem)8 Test (org.junit.Test)7 AndSegmentItem (com.yahoo.prelude.query.AndSegmentItem)1 DotProductItem (com.yahoo.prelude.query.DotProductItem)1 EquivItem (com.yahoo.prelude.query.EquivItem)1 ExactStringItem (com.yahoo.prelude.query.ExactStringItem)1 NearItem (com.yahoo.prelude.query.NearItem)1 NullItem (com.yahoo.prelude.query.NullItem)1