Skip to content

Commit

Permalink
A Failing Test
Browse files Browse the repository at this point in the history
  • Loading branch information
jalchr committed Feb 28, 2012
1 parent 0055424 commit 2106c20
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Raven.Tests/Bugs/FullTextSearchOnTags.cs
Expand Up @@ -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.