Permalink
Browse files

A Failing Test

  • Loading branch information...
1 parent 0055424 commit 2106c20ac1641ac4c8ee30e6f994c1156ebc5d7b @jalchr committed Feb 28, 2012
Showing with 34 additions and 0 deletions.
  1. +34 −0 Raven.Tests/Bugs/FullTextSearchOnTags.cs
@@ -321,5 +321,39 @@ public void Can_search_inner_words()
}
}
+ [Fact]
+ public void Can_search_inner_words_with_extra_condition()
+ {
+ using (var store = NewDocumentStore())
+ {
+ using (var session = store.OpenSession())
+ {
+ session.Store(new Image { Id = "1", Name = "Great Photo buddy" });
+ session.Store(new Image { Id = "2", Name = "Nice Photo of the sky" });
+ session.SaveChanges();
+ }
+
+ store.DatabaseCommands.PutIndex("test", new IndexDefinition
+ {
+ Map = "from doc in docs.Images select new { doc.Name }",
+ Indexes = {
+ { "Name", FieldIndexing.Analyzed }
+ }
+
+ });
+
+ using (var session = store.OpenSession())
+ {
+ var images = session.Query<Image>("test")
+ .Customize(x => x.WaitForNonStaleResults())
+ .OrderBy(x => x.Name)
+ .Search(x => x.Name, "Photo")
+ .Where(x => x.Id == "1")
+ .ToList();
+ Assert.NotEmpty(images);
+ Assert.True(images.Count == 1);
+ }
+ }
+ }
}
}

0 comments on commit 2106c20

Please sign in to comment.