Created
October 28, 2014 12:47
-
-
Save pvivera/a3738639a07e09294d9e to your computer and use it in GitHub Desktop.
RavenDB workaround for query with filter on long fails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RavenDbTests : RavenTestBase | |
{ | |
[Fact] | |
public void Hi() | |
{ | |
var store = NewDocumentStore(); | |
store.ExecuteIndex(new SomeIndex()); | |
using (var session = store.OpenSession()) | |
{ | |
session.Store(new Result {Number = 1}); | |
session.SaveChanges(); | |
} | |
using (var session = store.OpenSession()) | |
{ | |
var results1 = session.Advanced.LuceneQuery<Result>("SomeIndex") | |
.WaitForNonStaleResults() | |
.WhereGreaterThan("Number_Range", 0) | |
.ToList(); | |
Assert.Equal(1, results1.Count); // success | |
} | |
} | |
public class SomeIndex : AbstractIndexCreationTask<Result> | |
{ | |
public SomeIndex() | |
{ | |
Map = results => from result in results | |
select new | |
{ | |
result.Number | |
}; | |
} | |
} | |
public class Result | |
{ | |
public long Number { get; set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment