On Wed, May 9, 2012 at 11:44 AM, Matt Warren <mattd...@gmail.com> wrote:
> The problems is that the generated query doesn't have the brackets in the
> right place, if you put code below into your test it works as expected:
> var test = s.Advanced.LuceneQuery<Dummy>("Temp/Dummies/ByBooleanAndObject")
> .Where("Boolean:true OR (-Object:[[NULL_VALUE]] AND Object:*)")
> .ToList();
> Assert.Equal(3, test.Count);
> Note the brackets around the ".. AND .." statement to change the precedence. I think this is a bug in RavenDB as it's not generating the right query
> On Wednesday, 9 May 2012 07:46:46 UTC+1, Anders Wåglund wrote:
>> The following test fails using the latest code from
>> github.com/ravendb/ravendb
>> public void Fails()
>> {
>> using (var store = NewDocumentStore())
>> {
>> using (var s = store.OpenSession())
>> {
>> s.Store(new Dummy { Boolean = false, Object = null });
>> s.Store(new Dummy { Boolean = true, Object = null });
>> s.Store(new Dummy { Boolean = false, Object = new Dummy() });
>> s.Store(new Dummy { Boolean = true, Object = new Dummy() });
>> s.SaveChanges();
>> }
>> using (var s = store.OpenSession())
>> {
>> var objects = s.Query<Dummy>()
>> .Customize(x => x.WaitForNonStaleResults())
>> .Where(x => x.Boolean || x.Object != null)
>> .ToArray();
On Wednesday, May 9, 2012 12:51:30 PM UTC+2, Oren Eini wrote:
> Yep, fixed now, will be in the next build
> On Wed, May 9, 2012 at 11:44 AM, Matt Warren <mattd...@gmail.com> wrote:
>> The problems is that the generated query doesn't have the brackets in the >> right place, if you put code below into your test it works as expected:
>> var test = s.Advanced.LuceneQuery<Dummy>("Temp/Dummies/ByBooleanAndObject")
>> .Where("Boolean:true OR (-Object:[[NULL_VALUE]] AND Object:*)")
>> .ToList();
>> Assert.Equal(3, test.Count);
>> Note the brackets around the ".. AND .." statement to change the precedence. I think this is a bug in RavenDB as it's not generating the right query
>> On Wednesday, 9 May 2012 07:46:46 UTC+1, Anders Wåglund wrote:
>>> The following test fails using the latest code from >>> github.com/ravendb/ravendb
>>> public void Fails()
>>> {
>>> using (var store = NewDocumentStore())
>>> {
>>> using (var s = store.OpenSession())
>>> {
>>> s.Store(new Dummy { Boolean = false, Object = null });
>>> s.Store(new Dummy { Boolean = true, Object = null });
>>> s.Store(new Dummy { Boolean = false, Object = new Dummy() });
>>> s.Store(new Dummy { Boolean = true, Object = new Dummy() });
>>> s.SaveChanges();
>>> }
>>> using (var s = store.OpenSession())
>>> {
>>> var objects = s.Query<Dummy>()
>>> .Customize(x => x.WaitForNonStaleResults())
>>> .Where(x => x.Boolean || x.Object != null)
>>> .ToArray();
On Wednesday, May 9, 2012 12:51:30 PM UTC+2, Oren Eini wrote:
> Yep, fixed now, will be in the next build
> On Wed, May 9, 2012 at 11:44 AM, Matt Warren <mattd...@gmail.com> wrote:
>> The problems is that the generated query doesn't have the brackets in the >> right place, if you put code below into your test it works as expected:
>> var test = s.Advanced.LuceneQuery<Dummy>("Temp/Dummies/ByBooleanAndObject")
>> .Where("Boolean:true OR (-Object:[[NULL_VALUE]] AND Object:*)")
>> .ToList();
>> Assert.Equal(3, test.Count);
>> Note the brackets around the ".. AND .." statement to change the precedence. I think this is a bug in RavenDB as it's not generating the right query
>> On Wednesday, 9 May 2012 07:46:46 UTC+1, Anders Wåglund wrote:
>>> The following test fails using the latest code from >>> github.com/ravendb/ravendb
>>> public void Fails()
>>> {
>>> using (var store = NewDocumentStore())
>>> {
>>> using (var s = store.OpenSession())
>>> {
>>> s.Store(new Dummy { Boolean = false, Object = null });
>>> s.Store(new Dummy { Boolean = true, Object = null });
>>> s.Store(new Dummy { Boolean = false, Object = new Dummy() });
>>> s.Store(new Dummy { Boolean = true, Object = new Dummy() });
>>> s.SaveChanges();
>>> }
>>> using (var s = store.OpenSession())
>>> {
>>> var objects = s.Query<Dummy>()
>>> .Customize(x => x.WaitForNonStaleResults())
>>> .Where(x => x.Boolean || x.Object != null)
>>> .ToArray();
On Wed, May 9, 2012 at 3:45 PM, Anders Wåglund <and...@waglund.se> wrote:
> Will there be a new stable candidate with this fix, or was it too late?
> On Wednesday, May 9, 2012 12:51:30 PM UTC+2, Oren Eini wrote:
>> Yep, fixed now, will be in the next build
>> On Wed, May 9, 2012 at 11:44 AM, Matt Warren <mattd...@gmail.com> wrote:
>>> The problems is that the generated query doesn't have the brackets in
>>> the right place, if you put code below into your test it works as expected:
>>> var test = s.Advanced.**LuceneQuery<Dummy>("Temp/**Dummies/ByBooleanAndObject")
>>> .Where("Boolean:true OR (-**Object:[[NULL_VALUE]] AND **Object:*)")
>>> .ToList();
>>> Assert.Equal(3, test.Count);
>>> Note the brackets around the ".. AND .." statement to change the precedence. I think this is a bug in RavenDB as it's not generating the right query
>>> On Wednesday, 9 May 2012 07:46:46 UTC+1, Anders Wåglund wrote:
>>>> The following test fails using the latest code from
>>>> github.com/ravendb/ravendb
>>>> public void Fails()
>>>> {
>>>> using (var store = NewDocumentStore())
>>>> {
>>>> using (var s = store.OpenSession())
>>>> {
>>>> s.Store(new Dummy { Boolean = false, Object = null });
>>>> s.Store(new Dummy { Boolean = true, Object = null });
>>>> s.Store(new Dummy { Boolean = false, Object = new Dummy()
>>>> });
>>>> s.Store(new Dummy { Boolean = true, Object = new Dummy() });
>>>> s.SaveChanges();
>>>> }
>>>> using (var s = store.OpenSession())
>>>> {
>>>> var objects = s.Query<Dummy>()
>>>> .Customize(x => x.WaitForNonStaleResults())
>>>> .Where(x => x.Boolean || x.Object != null)
>>>> .ToArray();