Search in sources :

Example 11 with NotItem

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

the class ParseTestCase method testNegativeWordsParsing1.

@Test
public void testNegativeWordsParsing1() {
    Item root = tester.assertParsed("+a -b", "a -b", Query.Type.WEB);
    assertFalse(((NotItem) root).getItem(0).isProtected());
    assertTrue(((NotItem) root).getItem(1).isProtected());
}
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) NotItem(com.yahoo.prelude.query.NotItem) Test(org.junit.Test)

Aggregations

NotItem (com.yahoo.prelude.query.NotItem)11 WordItem (com.yahoo.prelude.query.WordItem)9 Test (org.junit.Test)8 AndItem (com.yahoo.prelude.query.AndItem)6 CompositeItem (com.yahoo.prelude.query.CompositeItem)4 Item (com.yahoo.prelude.query.Item)3 OrItem (com.yahoo.prelude.query.OrItem)3 RankItem (com.yahoo.prelude.query.RankItem)3 SubstringItem (com.yahoo.prelude.query.SubstringItem)3 Query (com.yahoo.search.Query)3 IntItem (com.yahoo.prelude.query.IntItem)2 PhraseItem (com.yahoo.prelude.query.PhraseItem)2 PhraseSegmentItem (com.yahoo.prelude.query.PhraseSegmentItem)2 PrefixItem (com.yahoo.prelude.query.PrefixItem)2 SuffixItem (com.yahoo.prelude.query.SuffixItem)2 Index (com.yahoo.prelude.Index)1 EquivItem (com.yahoo.prelude.query.EquivItem)1 MarkerWordItem (com.yahoo.prelude.query.MarkerWordItem)1 NearItem (com.yahoo.prelude.query.NearItem)1 NullItem (com.yahoo.prelude.query.NullItem)1