Exemplo n.º 1
0
 public void TestPhraseQueryWithDefaultIndex_2()
 {
     using (var index = TestHelper.PrepareIndexForSearch(new PersistentIndexName(TestFolder)))
     {
         using (var query = new PhraseQuery(
                    new TermQuery(TestHelper.GetPostingList(index, "this")),
                    new TermQuery(TestHelper.GetPostingList(index, "is"))))
         {
             var result   = query.ExecuteToString();
             var expected = "{[3,1,1], [3,1,2]}, {[6,1,8], [6,1,9]}";
             Assert.Equal(expected, result);
         }
     }
 }
Exemplo n.º 2
0
 public void TestPhraseQueryWithDefaultIndex_1()
 {
     using (var index = TestHelper.PrepareIndexForSearch(new PersistentIndexName(TestFolder)))
     {
         using (var query = new PhraseQuery(
                    new TermQuery(TestHelper.GetPostingList(index, "search")),
                    new TermQuery(TestHelper.GetPostingList(index, "only"))))
         {
             var result   = query.ExecuteToString();
             var expected = "{[5,1,3], [5,1,4]}";
             Assert.Equal(expected, result);
         }
     }
 }