This is the index: public class Data_Search : AbstractIndexCreationTask<Data, Data_Search.Result> { public class Result { public string Text; public string Texts;
}
public Data_Search() { Map = d => from d in data select new { d.Text, Texts = new object[] { d.Text, d.Variants.Select(x => x.Text) }, d.Type
This is the query I'm using: var q = session.Advanced.LuceneQuery<Data, Data_Search>() .UsingDefaultOperator(QueryOperator.And) .OpenSubclause() .Search("Text", text) //.Boost(1.5m) .OrElse() .Search("Texts", text) .CloseSubclause() .AndAlso() .OpenSubclause() .WhereEquals(x => x.Type, type1) .OrElse() .WhereEquals(x => x.Type, type2) .CloseSubclause() .ToList();
As soon as I uncomment //.Boost(1.5m) the query will no longer return any results. This is true irregardless of where i put it and also true when I set the same boost on both sides of the OrElse. The only boost value that works is 1m and I suspect that is due to it being the default value.
Some additional info: This only seems to happen when no results are
found for .Search("Text", text) but results are found
for .OrElse().Search("Texts", text).
On Aug 3, 1:45 am, Tobias Sebring <tsebr...@gmail.com> wrote:
> This is the index:
> public class Data_Search : AbstractIndexCreationTask<Data,
> Data_Search.Result>
> {
> public class Result
> {
> public string Text;
> public string Texts;
> }
> public Data_Search()
> {
> Map = d => from d in data
> select new
> {
> d.Text,
> Texts = new object[] { d.Text, d.Variants.Select(x => x.Text) },
> d.Type
> As soon as I uncomment //.Boost(1.5m) the query will no longer return any
> results. This is true irregardless of where i put it and also true when I
> set the same boost on both sides of the OrElse. The only boost value that
> works is 1m and I suspect that is due to it being the default value.
On Fri, Aug 3, 2012 at 2:53 AM, Tobias Sebring <tsebr...@gmail.com> wrote:
> Some additional info: This only seems to happen when no results are
> found for .Search("Text", text) but results are found
> for .OrElse().Search("Texts", text).
> On Aug 3, 1:45 am, Tobias Sebring <tsebr...@gmail.com> wrote:
> > This is the index:
> > public class Data_Search : AbstractIndexCreationTask<Data,
> > Data_Search.Result>
> > {
> > public class Result
> > {
> > public string Text;
> > public string Texts;
> > }
> > public Data_Search()
> > {
> > Map = d => from d in data
> > select new
> > {
> > d.Text,
> > Texts = new object[] { d.Text, d.Variants.Select(x => x.Text) },
> > d.Type
> > As soon as I uncomment //.Boost(1.5m) the query will no longer return any
> > results. This is true irregardless of where i put it and also true when I
> > set the same boost on both sides of the OrElse. The only boost value that
> > works is 1m and I suspect that is due to it being the default value.
Query 1 will succeed due to .Boost(1m) (1m being key)
Query 2 will fail due to .Boost(1.5m) and matching on .OrElse
Query 3 will succeed even though .Boost(1.5m) due to matching
on .Where before .OrElse
I added another weird case in there which I would be happy if you
could have a look at. When using .OrElse.Not.Where(x => x.Type, type)
no match will be returned even though there is one document in the
index that should match this case. The code utilizes a workaround
which only works when there are two Types: .OrElse.Where(x => x.Type,
type == DataType.Type1 ? DataType.Type2 : DataType.Type1).
On Aug 3, 7:44 am, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
wrote:
> On Fri, Aug 3, 2012 at 2:53 AM, Tobias Sebring <tsebr...@gmail.com> wrote:
> > Some additional info: This only seems to happen when no results are
> > found for .Search("Text", text) but results are found
> > for .OrElse().Search("Texts", text).
> > On Aug 3, 1:45 am, Tobias Sebring <tsebr...@gmail.com> wrote:
> > > This is the index:
> > > public class Data_Search : AbstractIndexCreationTask<Data,
> > > Data_Search.Result>
> > > {
> > > public class Result
> > > {
> > > public string Text;
> > > public string Texts;
> > > }
> > > public Data_Search()
> > > {
> > > Map = d => from d in data
> > > select new
> > > {
> > > d.Text,
> > > Texts = new object[] { d.Text, d.Variants.Select(x => x.Text) },
> > > d.Type
> > > As soon as I uncomment //.Boost(1.5m) the query will no longer return any
> > > results. This is true irregardless of where i put it and also true when I
> > > set the same boost on both sides of the OrElse. The only boost value that
> > > works is 1m and I suspect that is due to it being the default value.
> Query 1 will succeed due to .Boost(1m) (1m being key)
> Query 2 will fail due to .Boost(1.5m) and matching on .OrElse
> Query 3 will succeed even though .Boost(1.5m) due to matching
> on .Where before .OrElse
> I added another weird case in there which I would be happy if you
> could have a look at. When using .OrElse.Not.Where(x => x.Type, type)
> no match will be returned even though there is one document in the
> index that should match this case. The code utilizes a workaround
> which only works when there are two Types: .OrElse.Where(x => x.Type,
> type == DataType.Type1 ? DataType.Type2 : DataType.Type1).
> On Aug 3, 7:44 am, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> wrote:
> > Can you create a failing test?
> > On Fri, Aug 3, 2012 at 2:53 AM, Tobias Sebring <tsebr...@gmail.com>
> wrote:
> > > Some additional info: This only seems to happen when no results are
> > > found for .Search("Text", text) but results are found
> > > for .OrElse().Search("Texts", text).
> > > On Aug 3, 1:45 am, Tobias Sebring <tsebr...@gmail.com> wrote:
> > > > This is the index:
> > > > public class Data_Search : AbstractIndexCreationTask<Data,
> > > > Data_Search.Result>
> > > > {
> > > > public class Result
> > > > {
> > > > public string Text;
> > > > public string Texts;
> > > > }
> > > > public Data_Search()
> > > > {
> > > > Map = d => from d in data
> > > > select new
> > > > {
> > > > d.Text,
> > > > Texts = new object[] { d.Text, d.Variants.Select(x => x.Text) },
> > > > d.Type
> > > > As soon as I uncomment //.Boost(1.5m) the query will no longer
> return any
> > > > results. This is true irregardless of where i put it and also true
> when I
> > > > set the same boost on both sides of the OrElse. The only boost value
> that
> > > > works is 1m and I suspect that is due to it being the default value.
That is odd. I have run this query many-many times and the second
query have never been successful. I just ran it again on a fresh
ravendb and it fails every time.
Any idea what could be causing this and/or what parameters in my
environment that is not part of the solution could play a part in the
causing the query to fail?
On Aug 3, 10:46 am, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
wrote:
> > Query 1 will succeed due to .Boost(1m) (1m being key)
> > Query 2 will fail due to .Boost(1.5m) and matching on .OrElse
> > Query 3 will succeed even though .Boost(1.5m) due to matching
> > on .Where before .OrElse
> > I added another weird case in there which I would be happy if you
> > could have a look at. When using .OrElse.Not.Where(x => x.Type, type)
> > no match will be returned even though there is one document in the
> > index that should match this case. The code utilizes a workaround
> > which only works when there are two Types: .OrElse.Where(x => x.Type,
> > type == DataType.Type1 ? DataType.Type2 : DataType.Type1).
> > On Aug 3, 7:44 am, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> > wrote:
> > > Can you create a failing test?
> > > On Fri, Aug 3, 2012 at 2:53 AM, Tobias Sebring <tsebr...@gmail.com>
> > wrote:
> > > > Some additional info: This only seems to happen when no results are
> > > > found for .Search("Text", text) but results are found
> > > > for .OrElse().Search("Texts", text).
> > > > On Aug 3, 1:45 am, Tobias Sebring <tsebr...@gmail.com> wrote:
> > > > > This is the index:
> > > > > public class Data_Search : AbstractIndexCreationTask<Data,
> > > > > Data_Search.Result>
> > > > > {
> > > > > public class Result
> > > > > {
> > > > > public string Text;
> > > > > public string Texts;
> > > > > }
> > > > > public Data_Search()
> > > > > {
> > > > > Map = d => from d in data
> > > > > select new
> > > > > {
> > > > > d.Text,
> > > > > Texts = new object[] { d.Text, d.Variants.Select(x => x.Text) },
> > > > > d.Type
> > > > > As soon as I uncomment //.Boost(1.5m) the query will no longer
> > return any
> > > > > results. This is true irregardless of where i put it and also true
> > when I
> > > > > set the same boost on both sides of the OrElse. The only boost value
> > that
> > > > > works is 1m and I suspect that is due to it being the default value.
On Fri, Aug 3, 2012 at 12:08 PM, Tobias Sebring <tsebr...@gmail.com> wrote:
> That is odd. I have run this query many-many times and the second
> query have never been successful. I just ran it again on a fresh
> ravendb and it fails every time.
> Any idea what could be causing this and/or what parameters in my
> environment that is not part of the solution could play a part in the
> causing the query to fail?
> On Aug 3, 10:46 am, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> wrote:
> > When running this, I get:
> > Initializing...
> > Deleting previously inserted documents...
> > Importing data...
> > Data import completed...
> > Waiting for non-stale index and querying...
> > .Boost(1m): This query will succeed...
> > Query returned 1 results...
> > Changed to .Boost(1.5m): This query will fail...
> > Query returned 1 results...
> > .Boost(1.5m) but this time we match on .Search("Text", name): This query
> > will su
> > cceed...
> > Query returned 1 results...
> > > Query 1 will succeed due to .Boost(1m) (1m being key)
> > > Query 2 will fail due to .Boost(1.5m) and matching on .OrElse
> > > Query 3 will succeed even though .Boost(1.5m) due to matching
> > > on .Where before .OrElse
> > > I added another weird case in there which I would be happy if you
> > > could have a look at. When using .OrElse.Not.Where(x => x.Type, type)
> > > no match will be returned even though there is one document in the
> > > index that should match this case. The code utilizes a workaround
> > > which only works when there are two Types: .OrElse.Where(x => x.Type,
> > > type == DataType.Type1 ? DataType.Type2 : DataType.Type1).
> > > On Aug 3, 7:44 am, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> > > wrote:
> > > > Can you create a failing test?
> > > > On Fri, Aug 3, 2012 at 2:53 AM, Tobias Sebring <tsebr...@gmail.com>
> > > wrote:
> > > > > Some additional info: This only seems to happen when no results are
> > > > > found for .Search("Text", text) but results are found
> > > > > for .OrElse().Search("Texts", text).
> > > > > On Aug 3, 1:45 am, Tobias Sebring <tsebr...@gmail.com> wrote:
> > > > > > This is the index:
> > > > > > public class Data_Search : AbstractIndexCreationTask<Data,
> > > > > > Data_Search.Result>
> > > > > > {
> > > > > > public class Result
> > > > > > {
> > > > > > public string Text;
> > > > > > public string Texts;
> > > > > > }
> > > > > > public Data_Search()
> > > > > > {
> > > > > > Map = d => from d in data
> > > > > > select new
> > > > > > {
> > > > > > d.Text,
> > > > > > Texts = new object[] { d.Text, d.Variants.Select(x => x.Text) },
> > > > > > d.Type
> > > > > > As soon as I uncomment //.Boost(1.5m) the query will no longer
> > > return any
> > > > > > results. This is true irregardless of where i put it and also
> true
> > > when I
> > > > > > set the same boost on both sides of the OrElse. The only boost
> value
> > > that
> > > > > > works is 1m and I suspect that is due to it being the default
> value.
This line is used for each of the querys:
var datas = q.WaitForNonStaleResults().ToList();
Do I need to put it further up in the query expression? The code where
I initially experienced this issue is fully indexed with not a single
stale index and no write operations after initial import.
Could it be a culture issue or such?
On Aug 3, 11:11 am, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
wrote:
> You don't have WaitForNonStaleResults there, it might be that
> On Fri, Aug 3, 2012 at 12:08 PM, Tobias Sebring <tsebr...@gmail.com> wrote:
> > That is odd. I have run this query many-many times and the second
> > query have never been successful. I just ran it again on a fresh
> > ravendb and it fails every time.
> > Any idea what could be causing this and/or what parameters in my
> > environment that is not part of the solution could play a part in the
> > causing the query to fail?
> > On Aug 3, 10:46 am, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> > wrote:
> > > When running this, I get:
> > > Initializing...
> > > Deleting previously inserted documents...
> > > Importing data...
> > > Data import completed...
> > > Waiting for non-stale index and querying...
> > > .Boost(1m): This query will succeed...
> > > Query returned 1 results...
> > > Changed to .Boost(1.5m): This query will fail...
> > > Query returned 1 results...
> > > .Boost(1.5m) but this time we match on .Search("Text", name): This query
> > > will su
> > > cceed...
> > > Query returned 1 results...
> > > > Query 1 will succeed due to .Boost(1m) (1m being key)
> > > > Query 2 will fail due to .Boost(1.5m) and matching on .OrElse
> > > > Query 3 will succeed even though .Boost(1.5m) due to matching
> > > > on .Where before .OrElse
> > > > I added another weird case in there which I would be happy if you
> > > > could have a look at. When using .OrElse.Not.Where(x => x.Type, type)
> > > > no match will be returned even though there is one document in the
> > > > index that should match this case. The code utilizes a workaround
> > > > which only works when there are two Types: .OrElse.Where(x => x.Type,
> > > > type == DataType.Type1 ? DataType.Type2 : DataType.Type1).
> > > > On Aug 3, 7:44 am, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> > > > wrote:
> > > > > Can you create a failing test?
> > > > > On Fri, Aug 3, 2012 at 2:53 AM, Tobias Sebring <tsebr...@gmail.com>
> > > > wrote:
> > > > > > Some additional info: This only seems to happen when no results are
> > > > > > found for .Search("Text", text) but results are found
> > > > > > for .OrElse().Search("Texts", text).
> > > > > > On Aug 3, 1:45 am, Tobias Sebring <tsebr...@gmail.com> wrote:
> > > > > > > This is the index:
> > > > > > > public class Data_Search : AbstractIndexCreationTask<Data,
> > > > > > > Data_Search.Result>
> > > > > > > {
> > > > > > > public class Result
> > > > > > > {
> > > > > > > public string Text;
> > > > > > > public string Texts;
> > > > > > > As soon as I uncomment //.Boost(1.5m) the query will no longer
> > > > return any
> > > > > > > results. This is true irregardless of where i put it and also
> > true
> > > > when I
> > > > > > > set the same boost on both sides of the OrElse. The only boost
> > value
> > > > that
> > > > > > > works is 1m and I suspect that is due to it being the default
> > value.
On Fri, Aug 3, 2012 at 12:19 PM, Tobias Sebring <tsebr...@gmail.com> wrote:
> This line is used for each of the querys:
> var datas = q.WaitForNonStaleResults().ToList();
> No, it doesn't matter
> Do I need to put it further up in the query expression? The code where
> I initially experienced this issue is fully indexed with not a single
> stale index and no write operations after initial import.
> On Aug 3, 11:11 am, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> wrote:
> > You don't have WaitForNonStaleResults there, it might be that
> > On Fri, Aug 3, 2012 at 12:08 PM, Tobias Sebring <tsebr...@gmail.com>
> wrote:
> > > That is odd. I have run this query many-many times and the second
> > > query have never been successful. I just ran it again on a fresh
> > > ravendb and it fails every time.
> > > Any idea what could be causing this and/or what parameters in my
> > > environment that is not part of the solution could play a part in the
> > > causing the query to fail?
> > > On Aug 3, 10:46 am, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> > > wrote:
> > > > When running this, I get:
> > > > Initializing...
> > > > Deleting previously inserted documents...
> > > > Importing data...
> > > > Data import completed...
> > > > Waiting for non-stale index and querying...
> > > > .Boost(1m): This query will succeed...
> > > > Query returned 1 results...
> > > > Changed to .Boost(1.5m): This query will fail...
> > > > Query returned 1 results...
> > > > .Boost(1.5m) but this time we match on .Search("Text", name): This
> query
> > > > will su
> > > > cceed...
> > > > Query returned 1 results...
> > > > Which seems to be fine.
> > > > On Fri, Aug 3, 2012 at 11:37 AM, Tobias Sebring <tsebr...@gmail.com>
> > > wrote:
> > > > > Here is a complete repro on 1.2.2055-Unstable:
> > > > >https://dl.dropbox.com/u/6420016/DataQuery.zip
> > > > > Query 1 will succeed due to .Boost(1m) (1m being key)
> > > > > Query 2 will fail due to .Boost(1.5m) and matching on .OrElse
> > > > > Query 3 will succeed even though .Boost(1.5m) due to matching
> > > > > on .Where before .OrElse
> > > > > I added another weird case in there which I would be happy if you
> > > > > could have a look at. When using .OrElse.Not.Where(x => x.Type,
> type)
> > > > > no match will be returned even though there is one document in the
> > > > > index that should match this case. The code utilizes a workaround
> > > > > which only works when there are two Types: .OrElse.Where(x =>
> x.Type,
> > > > > type == DataType.Type1 ? DataType.Type2 : DataType.Type1).
> > > > > On Aug 3, 7:44 am, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> > > > > wrote:
> > > > > > Can you create a failing test?
> > > > > > On Fri, Aug 3, 2012 at 2:53 AM, Tobias Sebring <
> tsebr...@gmail.com>
> > > > > wrote:
> > > > > > > Some additional info: This only seems to happen when no
> results are
> > > > > > > found for .Search("Text", text) but results are found
> > > > > > > for .OrElse().Search("Texts", text).
> > > > > > > On Aug 3, 1:45 am, Tobias Sebring <tsebr...@gmail.com> wrote:
> > > > > > > > This is the index:
> > > > > > > > public class Data_Search : AbstractIndexCreationTask<Data,
> > > > > > > > Data_Search.Result>
> > > > > > > > {
> > > > > > > > public class Result
> > > > > > > > {
> > > > > > > > public string Text;
> > > > > > > > public string Texts;
> > > > > > > > As soon as I uncomment //.Boost(1.5m) the query will no
> longer
> > > > > return any
> > > > > > > > results. This is true irregardless of where i put it and also
> > > true
> > > > > when I
> > > > > > > > set the same boost on both sides of the OrElse. The only
> boost
> > > value
> > > > > that
> > > > > > > > works is 1m and I suspect that is due to it being the default
> > > value.
Yep. It's the culture on my maching. Add this at the top of the main
function and the second query will fail:
Thread.CurrentThread.CurrentCulture = new CultureInfo("sv-SE");
On Aug 3, 11:19 am, Tobias Sebring <tsebr...@gmail.com> wrote:
> This line is used for each of the querys:
> var datas = q.WaitForNonStaleResults().ToList();
> Do I need to put it further up in the query expression? The code where
> I initially experienced this issue is fully indexed with not a single
> stale index and no write operations after initial import.
> Could it be a culture issue or such?
> On Aug 3, 11:11 am, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> wrote:
> > You don't have WaitForNonStaleResults there, it might be that
> > On Fri, Aug 3, 2012 at 12:08 PM, Tobias Sebring <tsebr...@gmail.com> wrote:
> > > That is odd. I have run this query many-many times and the second
> > > query have never been successful. I just ran it again on a fresh
> > > ravendb and it fails every time.
> > > Any idea what could be causing this and/or what parameters in my
> > > environment that is not part of the solution could play a part in the
> > > causing the query to fail?
> > > On Aug 3, 10:46 am, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> > > wrote:
> > > > When running this, I get:
> > > > Initializing...
> > > > Deleting previously inserted documents...
> > > > Importing data...
> > > > Data import completed...
> > > > Waiting for non-stale index and querying...
> > > > .Boost(1m): This query will succeed...
> > > > Query returned 1 results...
> > > > Changed to .Boost(1.5m): This query will fail...
> > > > Query returned 1 results...
> > > > .Boost(1.5m) but this time we match on .Search("Text", name): This query
> > > > will su
> > > > cceed...
> > > > Query returned 1 results...
> > > > Which seems to be fine.
> > > > On Fri, Aug 3, 2012 at 11:37 AM, Tobias Sebring <tsebr...@gmail.com>
> > > wrote:
> > > > > Here is a complete repro on 1.2.2055-Unstable:
> > > > >https://dl.dropbox.com/u/6420016/DataQuery.zip
> > > > > Query 1 will succeed due to .Boost(1m) (1m being key)
> > > > > Query 2 will fail due to .Boost(1.5m) and matching on .OrElse
> > > > > Query 3 will succeed even though .Boost(1.5m) due to matching
> > > > > on .Where before .OrElse
> > > > > I added another weird case in there which I would be happy if you
> > > > > could have a look at. When using .OrElse.Not.Where(x => x.Type, type)
> > > > > no match will be returned even though there is one document in the
> > > > > index that should match this case. The code utilizes a workaround
> > > > > which only works when there are two Types: .OrElse.Where(x => x.Type,
> > > > > type == DataType.Type1 ? DataType.Type2 : DataType.Type1).
> > > > > On Aug 3, 7:44 am, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> > > > > wrote:
> > > > > > Can you create a failing test?
> > > > > > On Fri, Aug 3, 2012 at 2:53 AM, Tobias Sebring <tsebr...@gmail.com>
> > > > > wrote:
> > > > > > > Some additional info: This only seems to happen when no results are
> > > > > > > found for .Search("Text", text) but results are found
> > > > > > > for .OrElse().Search("Texts", text).
> > > > > > > On Aug 3, 1:45 am, Tobias Sebring <tsebr...@gmail.com> wrote:
> > > > > > > > This is the index:
> > > > > > > > public class Data_Search : AbstractIndexCreationTask<Data,
> > > > > > > > Data_Search.Result>
> > > > > > > > {
> > > > > > > > public class Result
> > > > > > > > {
> > > > > > > > public string Text;
> > > > > > > > public string Texts;
> > > > > > > > As soon as I uncomment //.Boost(1.5m) the query will no longer
> > > > > return any
> > > > > > > > results. This is true irregardless of where i put it and also
> > > true
> > > > > when I
> > > > > > > > set the same boost on both sides of the OrElse. The only boost
> > > value
> > > > > that
> > > > > > > > works is 1m and I suspect that is due to it being the default
> > > value.
I don't think the culture should be relevant in my code but I may be
wrong? If I run the second query trying to match a English string that
I also added to .Secondary on the document - it will still fail.
I had a friend run the same project on his manching with the same
result. Our default culture (sv-SE) will cause the second query to
fail, but changing the default culture for the thread to en-US causes
the second query to succeed.
On Aug 3, 11:25 am, Tobias Sebring <tsebr...@gmail.com> wrote:
> Yep. It's the culture on my maching. Add this at the top of the main
> function and the second query will fail:
> Thread.CurrentThread.CurrentCulture = new CultureInfo("sv-SE");
> On Aug 3, 11:19 am, Tobias Sebring <tsebr...@gmail.com> wrote:
> > This line is used for each of the querys:
> > var datas = q.WaitForNonStaleResults().ToList();
> > Do I need to put it further up in the query expression? The code where
> > I initially experienced this issue is fully indexed with not a single
> > stale index and no write operations after initial import.
> > Could it be a culture issue or such?
> > On Aug 3, 11:11 am, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> > wrote:
> > > You don't have WaitForNonStaleResults there, it might be that
> > > On Fri, Aug 3, 2012 at 12:08 PM, Tobias Sebring <tsebr...@gmail.com> wrote:
> > > > That is odd. I have run this query many-many times and the second
> > > > query have never been successful. I just ran it again on a fresh
> > > > ravendb and it fails every time.
> > > > Any idea what could be causing this and/or what parameters in my
> > > > environment that is not part of the solution could play a part in the
> > > > causing the query to fail?
> > > > On Aug 3, 10:46 am, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> > > > wrote:
> > > > > When running this, I get:
> > > > > .Boost(1m): This query will succeed...
> > > > > Query returned 1 results...
> > > > > Changed to .Boost(1.5m): This query will fail...
> > > > > Query returned 1 results...
> > > > > .Boost(1.5m) but this time we match on .Search("Text", name): This query
> > > > > will su
> > > > > cceed...
> > > > > Query returned 1 results...
> > > > > Which seems to be fine.
> > > > > On Fri, Aug 3, 2012 at 11:37 AM, Tobias Sebring <tsebr...@gmail.com>
> > > > wrote:
> > > > > > Here is a complete repro on 1.2.2055-Unstable:
> > > > > >https://dl.dropbox.com/u/6420016/DataQuery.zip
> > > > > > Query 1 will succeed due to .Boost(1m) (1m being key)
> > > > > > Query 2 will fail due to .Boost(1.5m) and matching on .OrElse
> > > > > > Query 3 will succeed even though .Boost(1.5m) due to matching
> > > > > > on .Where before .OrElse
> > > > > > I added another weird case in there which I would be happy if you
> > > > > > could have a look at. When using .OrElse.Not.Where(x => x.Type, type)
> > > > > > no match will be returned even though there is one document in the
> > > > > > index that should match this case. The code utilizes a workaround
> > > > > > which only works when there are two Types: .OrElse.Where(x => x.Type,
> > > > > > type == DataType.Type1 ? DataType.Type2 : DataType.Type1).
> > > > > > On Aug 3, 7:44 am, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> > > > > > wrote:
> > > > > > > Can you create a failing test?
> > > > > > > On Fri, Aug 3, 2012 at 2:53 AM, Tobias Sebring <tsebr...@gmail.com>
> > > > > > wrote:
> > > > > > > > Some additional info: This only seems to happen when no results are
> > > > > > > > found for .Search("Text", text) but results are found
> > > > > > > > for .OrElse().Search("Texts", text).
> > > > > > > > On Aug 3, 1:45 am, Tobias Sebring <tsebr...@gmail.com> wrote:
> > > > > > > > > This is the index:
> > > > > > > > > public class Data_Search : AbstractIndexCreationTask<Data,
> > > > > > > > > Data_Search.Result>
> > > > > > > > > {
> > > > > > > > > public class Result
> > > > > > > > > {
> > > > > > > > > public string Text;
> > > > > > > > > public string Texts;
> > > > > > > > > As soon as I uncomment //.Boost(1.5m) the query will no longer
> > > > > > return any
> > > > > > > > > results. This is true irregardless of where i put it and also
> > > > true
> > > > > > when I
> > > > > > > > > set the same boost on both sides of the OrElse. The only boost
> > > > value
> > > > > > that
> > > > > > > > > works is 1m and I suspect that is due to it being the default
> > > > value.
On Fri, Aug 3, 2012 at 12:34 PM, Tobias Sebring <tsebr...@gmail.com> wrote:
> I don't think the culture should be relevant in my code but I may be
> wrong? If I run the second query trying to match a English string that
> I also added to .Secondary on the document - it will still fail.
> I had a friend run the same project on his manching with the same
> result. Our default culture (sv-SE) will cause the second query to
> fail, but changing the default culture for the thread to en-US causes
> the second query to succeed.
> On Aug 3, 11:25 am, Tobias Sebring <tsebr...@gmail.com> wrote:
> > Yep. It's the culture on my maching. Add this at the top of the main
> > function and the second query will fail:
> > Thread.CurrentThread.CurrentCulture = new CultureInfo("sv-SE");
> > On Aug 3, 11:19 am, Tobias Sebring <tsebr...@gmail.com> wrote:
> > > This line is used for each of the querys:
> > > var datas = q.WaitForNonStaleResults().ToList();
> > > Do I need to put it further up in the query expression? The code where
> > > I initially experienced this issue is fully indexed with not a single
> > > stale index and no write operations after initial import.
> > > Could it be a culture issue or such?
> > > On Aug 3, 11:11 am, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> > > wrote:
> > > > You don't have WaitForNonStaleResults there, it might be that
> > > > On Fri, Aug 3, 2012 at 12:08 PM, Tobias Sebring <tsebr...@gmail.com>
> wrote:
> > > > > That is odd. I have run this query many-many times and the second
> > > > > query have never been successful. I just ran it again on a fresh
> > > > > ravendb and it fails every time.
> > > > > Any idea what could be causing this and/or what parameters in my
> > > > > environment that is not part of the solution could play a part in
> the
> > > > > causing the query to fail?
> > > > > On Aug 3, 10:46 am, "Oren Eini (Ayende Rahien)" <aye...@ayende.com
> > > > > wrote:
> > > > > > When running this, I get:
> > > > > > .Boost(1m): This query will succeed...
> > > > > > Query returned 1 results...
> > > > > > Changed to .Boost(1.5m): This query will fail...
> > > > > > Query returned 1 results...
> > > > > > .Boost(1.5m) but this time we match on .Search("Text", name):
> This query
> > > > > > will su
> > > > > > cceed...
> > > > > > Query returned 1 results...
> > > > > > Which seems to be fine.
> > > > > > On Fri, Aug 3, 2012 at 11:37 AM, Tobias Sebring <
> tsebr...@gmail.com>
> > > > > wrote:
> > > > > > > Here is a complete repro on 1.2.2055-Unstable:
> > > > > > >https://dl.dropbox.com/u/6420016/DataQuery.zip
> > > > > > > Query 1 will succeed due to .Boost(1m) (1m being key)
> > > > > > > Query 2 will fail due to .Boost(1.5m) and matching on .OrElse
> > > > > > > Query 3 will succeed even though .Boost(1.5m) due to matching
> > > > > > > on .Where before .OrElse
> > > > > > > I added another weird case in there which I would be happy if
> you
> > > > > > > could have a look at. When using .OrElse.Not.Where(x =>
> x.Type, type)
> > > > > > > no match will be returned even though there is one document in
> the
> > > > > > > index that should match this case. The code utilizes a
> workaround
> > > > > > > which only works when there are two Types: .OrElse.Where(x =>
> x.Type,
> > > > > > > type == DataType.Type1 ? DataType.Type2 : DataType.Type1).
> > > > > > > On Aug 3, 7:44 am, "Oren Eini (Ayende Rahien)" <
> aye...@ayende.com>
> > > > > > > wrote:
> > > > > > > > Can you create a failing test?
> > > > > > > > On Fri, Aug 3, 2012 at 2:53 AM, Tobias Sebring <
> tsebr...@gmail.com>
> > > > > > > wrote:
> > > > > > > > > Some additional info: This only seems to happen when no
> results are
> > > > > > > > > found for .Search("Text", text) but results are found
> > > > > > > > > for .OrElse().Search("Texts", text).
> > > > > > > > > > As soon as I uncomment //.Boost(1.5m) the query will no
> longer
> > > > > > > return any
> > > > > > > > > > results. This is true irregardless of where i put it and
> also
> > > > > true
> > > > > > > when I
> > > > > > > > > > set the same boost on both sides of the OrElse. The only
> boost
> > > > > value
> > > > > > > that
> > > > > > > > > > works is 1m and I suspect that is due to it being the
> default
> > > > > value.
I mentioned another problem I'm having with the repro code in
that .OrElse.Not.Where(x => x.Type, type) never returns any results.
I'm using .WhereEquals(x => x.Type, type == DataType.Type1 ?
DataType.Type2 : DataType.Type1) to work around this fact.
Do you know if this is another bug or if I'm using .Not.WhereEquals
incorrectly?
The repro contains code to test this and you may
uncomment .Not.WhereEquals in each of the queries to reproduce the
issue:
.Not.WhereEquals(x => x.Type, type) //this does not work (why?)
//.WhereEquals(x => x.Type, type == DataType.Type1 ? DataType.Type2 :
DataType.Type1)
On Aug 3, 5:52 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
wrote:
> No, it isn't relevant.
> That is a bug, I'll fix it.
> On Fri, Aug 3, 2012 at 12:34 PM, Tobias Sebring <tsebr...@gmail.com> wrote:
> > I don't think the culture should be relevant in my code but I may be
> > wrong? If I run the second query trying to match a English string that
> > I also added to .Secondary on the document - it will still fail.
> > I had a friend run the same project on his manching with the same
> > result. Our default culture (sv-SE) will cause the second query to
> > fail, but changing the default culture for the thread to en-US causes
> > the second query to succeed.
> > On Aug 3, 11:25 am, Tobias Sebring <tsebr...@gmail.com> wrote:
> > > Yep. It's the culture on my maching. Add this at the top of the main
> > > function and the second query will fail:
> > > Thread.CurrentThread.CurrentCulture = new CultureInfo("sv-SE");
> > > On Aug 3, 11:19 am, Tobias Sebring <tsebr...@gmail.com> wrote:
> > > > This line is used for each of the querys:
> > > > var datas = q.WaitForNonStaleResults().ToList();
> > > > Do I need to put it further up in the query expression? The code where
> > > > I initially experienced this issue is fully indexed with not a single
> > > > stale index and no write operations after initial import.
> > > > Could it be a culture issue or such?
> > > > On Aug 3, 11:11 am, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> > > > wrote:
> > > > > You don't have WaitForNonStaleResults there, it might be that
> > > > > On Fri, Aug 3, 2012 at 12:08 PM, Tobias Sebring <tsebr...@gmail.com>
> > wrote:
> > > > > > That is odd. I have run this query many-many times and the second
> > > > > > query have never been successful. I just ran it again on a fresh
> > > > > > ravendb and it fails every time.
> > > > > > Any idea what could be causing this and/or what parameters in my
> > > > > > environment that is not part of the solution could play a part in
> > the
> > > > > > causing the query to fail?
> > > > > > On Aug 3, 10:46 am, "Oren Eini (Ayende Rahien)" <aye...@ayende.com
> > > > > > wrote:
> > > > > > > When running this, I get:
> > > > > > > .Boost(1m): This query will succeed...
> > > > > > > Query returned 1 results...
> > > > > > > Changed to .Boost(1.5m): This query will fail...
> > > > > > > Query returned 1 results...
> > > > > > > .Boost(1.5m) but this time we match on .Search("Text", name):
> > This query
> > > > > > > will su
> > > > > > > cceed...
> > > > > > > Query returned 1 results...
> > > > > > > Which seems to be fine.
> > > > > > > On Fri, Aug 3, 2012 at 11:37 AM, Tobias Sebring <
> > tsebr...@gmail.com>
> > > > > > wrote:
> > > > > > > > Here is a complete repro on 1.2.2055-Unstable:
> > > > > > > >https://dl.dropbox.com/u/6420016/DataQuery.zip
> > > > > > > > Query 1 will succeed due to .Boost(1m) (1m being key)
> > > > > > > > Query 2 will fail due to .Boost(1.5m) and matching on .OrElse
> > > > > > > > Query 3 will succeed even though .Boost(1.5m) due to matching
> > > > > > > > on .Where before .OrElse
> > > > > > > > I added another weird case in there which I would be happy if
> > you
> > > > > > > > could have a look at. When using .OrElse.Not.Where(x =>
> > x.Type, type)
> > > > > > > > no match will be returned even though there is one document in
> > the
> > > > > > > > index that should match this case. The code utilizes a
> > workaround
> > > > > > > > which only works when there are two Types: .OrElse.Where(x =>
> > x.Type,
> > > > > > > > type == DataType.Type1 ? DataType.Type2 : DataType.Type1).
> > > > > > > > On Aug 3, 7:44 am, "Oren Eini (Ayende Rahien)" <
> > aye...@ayende.com>
> > > > > > > > wrote:
> > > > > > > > > Can you create a failing test?
> > > > > > > > > On Fri, Aug 3, 2012 at 2:53 AM, Tobias Sebring <
> > tsebr...@gmail.com>
> > > > > > > > wrote:
> > > > > > > > > > Some additional info: This only seems to happen when no
> > results are
> > > > > > > > > > found for .Search("Text", text) but results are found
> > > > > > > > > > for .OrElse().Search("Texts", text).
> > > > > > > > > > > As soon as I uncomment //.Boost(1.5m) the query will no
> > longer
> > > > > > > > return any
> > > > > > > > > > > results. This is true irregardless of where i put it and
> > also
> > > > > > true
> > > > > > > > when I
> > > > > > > > > > > set the same boost on both sides of the OrElse. The only
> > boost
> > > > > > value
> > > > > > > > that
> > > > > > > > > > > works is 1m and I suspect that is due to it being the
> > default
> > > > > > value.
> > > > > > > > > > > This is on 1.2.2051-Unstable.
On Fri, Aug 3, 2012 at 7:33 PM, Tobias Sebring <tsebr...@gmail.com> wrote:
> I mentioned another problem I'm having with the repro code in
> that .OrElse.Not.Where(x => x.Type, type) never returns any results.
> I'm using .WhereEquals(x => x.Type, type == DataType.Type1 ?
> DataType.Type2 : DataType.Type1) to work around this fact.
> Do you know if this is another bug or if I'm using .Not.WhereEquals
> incorrectly?
> The repro contains code to test this and you may
> uncomment .Not.WhereEquals in each of the queries to reproduce the
> issue:
> .Not.WhereEquals(x => x.Type, type) //this does not work (why?)
> //.WhereEquals(x => x.Type, type == DataType.Type1 ? DataType.Type2 :
> DataType.Type1)
> On Aug 3, 5:52 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> wrote:
> > No, it isn't relevant.
> > That is a bug, I'll fix it.
> > On Fri, Aug 3, 2012 at 12:34 PM, Tobias Sebring <tsebr...@gmail.com>
> wrote:
> > > I don't think the culture should be relevant in my code but I may be
> > > wrong? If I run the second query trying to match a English string that
> > > I also added to .Secondary on the document - it will still fail.
> > > I had a friend run the same project on his manching with the same
> > > result. Our default culture (sv-SE) will cause the second query to
> > > fail, but changing the default culture for the thread to en-US causes
> > > the second query to succeed.
> > > On Aug 3, 11:25 am, Tobias Sebring <tsebr...@gmail.com> wrote:
> > > > Yep. It's the culture on my maching. Add this at the top of the main
> > > > function and the second query will fail:
> > > > Thread.CurrentThread.CurrentCulture = new CultureInfo("sv-SE");
> > > > On Aug 3, 11:19 am, Tobias Sebring <tsebr...@gmail.com> wrote:
> > > > > This line is used for each of the querys:
> > > > > var datas = q.WaitForNonStaleResults().ToList();
> > > > > Do I need to put it further up in the query expression? The code
> where
> > > > > I initially experienced this issue is fully indexed with not a
> single
> > > > > stale index and no write operations after initial import.
> > > > > Could it be a culture issue or such?
> > > > > On Aug 3, 11:11 am, "Oren Eini (Ayende Rahien)" <aye...@ayende.com
> > > > > wrote:
> > > > > > You don't have WaitForNonStaleResults there, it might be that
> > > > > > On Fri, Aug 3, 2012 at 12:08 PM, Tobias Sebring <
> tsebr...@gmail.com>
> > > wrote:
> > > > > > > That is odd. I have run this query many-many times and the
> second
> > > > > > > query have never been successful. I just ran it again on a
> fresh
> > > > > > > ravendb and it fails every time.
> > > > > > > Any idea what could be causing this and/or what parameters in
> my
> > > > > > > environment that is not part of the solution could play a part
> in
> > > the
> > > > > > > causing the query to fail?
> > > > > > > On Aug 3, 10:46 am, "Oren Eini (Ayende Rahien)" <
> aye...@ayende.com
> > > > > > > > .Boost(1m): This query will succeed...
> > > > > > > > Query returned 1 results...
> > > > > > > > Changed to .Boost(1.5m): This query will fail...
> > > > > > > > Query returned 1 results...
> > > > > > > > .Boost(1.5m) but this time we match on .Search("Text", name):
> > > This query
> > > > > > > > will su
> > > > > > > > cceed...
> > > > > > > > Query returned 1 results...
> > > > > > > > Which seems to be fine.
> > > > > > > > On Fri, Aug 3, 2012 at 11:37 AM, Tobias Sebring <
> > > tsebr...@gmail.com>
> > > > > > > wrote:
> > > > > > > > > Here is a complete repro on 1.2.2055-Unstable:
> > > > > > > > >https://dl.dropbox.com/u/6420016/DataQuery.zip
> > > > > > > > > Query 1 will succeed due to .Boost(1m) (1m being key)
> > > > > > > > > Query 2 will fail due to .Boost(1.5m) and matching on
> .OrElse
> > > > > > > > > Query 3 will succeed even though .Boost(1.5m) due to
> matching
> > > > > > > > > on .Where before .OrElse
> > > > > > > > > I added another weird case in there which I would be happy
> if
> > > you
> > > > > > > > > could have a look at. When using .OrElse.Not.Where(x =>
> > > x.Type, type)
> > > > > > > > > no match will be returned even though there is one
> document in
> > > the
> > > > > > > > > index that should match this case. The code utilizes a
> > > workaround
> > > > > > > > > which only works when there are two Types: .OrElse.Where(x
> =>
> > > x.Type,
> > > > > > > > > type == DataType.Type1 ? DataType.Type2 : DataType.Type1).
> > > > > > > > > On Aug 3, 7:44 am, "Oren Eini (Ayende Rahien)" <
> > > aye...@ayende.com>
> > > > > > > > > wrote:
> > > > > > > > > > Can you create a failing test?
> > > > > > > > > > On Fri, Aug 3, 2012 at 2:53 AM, Tobias Sebring <
> > > tsebr...@gmail.com>
> > > > > > > > > wrote:
> > > > > > > > > > > Some additional info: This only seems to happen when no
> > > results are
> > > > > > > > > > > found for .Search("Text", text) but results are found
> > > > > > > > > > > for .OrElse().Search("Texts", text).
> > > > > > > > > > > > As soon as I uncomment //.Boost(1.5m) the query will
> no
> > > longer
> > > > > > > > > return any
> > > > > > > > > > > > results. This is true irregardless of where i put it
> and
> > > also
> > > > > > > true
> > > > > > > > > when I
> > > > > > > > > > > > set the same boost on both sides of the OrElse. The
> only
> > > boost
> > > > > > > value
> > > > > > > > > that
> > > > > > > > > > > > works is 1m and I suspect that is due to it being the
> > > default
> > > > > > > value.
> > > > > > > > > > > > This is on 1.2.2051-Unstable.
> wrote:
> I can't follow this in pieces, can you show a full example?
> On Fri, Aug 3, 2012 at 7:33 PM, Tobias Sebring <tsebr...@gmail.com> wrote:
>> I mentioned another problem I'm having with the repro code in
>> that .OrElse.Not.Where(x => x.Type, type) never returns any results.
>> I'm using .WhereEquals(x => x.Type, type == DataType.Type1 ?
>> DataType.Type2 : DataType.Type1) to work around this fact.
>> Do you know if this is another bug or if I'm using .Not.WhereEquals
>> incorrectly?
>> The repro contains code to test this and you may
>> uncomment .Not.WhereEquals in each of the queries to reproduce the
>> issue:
>> .Not.WhereEquals(x => x.Type, type) //this does not work (why?)
>> //.WhereEquals(x => x.Type, type == DataType.Type1 ? DataType.Type2 :
>> DataType.Type1)
>> On Aug 3, 5:52 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
>> wrote:
>> > No, it isn't relevant.
>> > That is a bug, I'll fix it.
>> > On Fri, Aug 3, 2012 at 12:34 PM, Tobias Sebring <tsebr...@gmail.com>
>> wrote:
>> > > I don't think the culture should be relevant in my code but I may be
>> > > wrong? If I run the second query trying to match a English string that
>> > > I also added to .Secondary on the document - it will still fail.
>> > > I had a friend run the same project on his manching with the same
>> > > result. Our default culture (sv-SE) will cause the second query to
>> > > fail, but changing the default culture for the thread to en-US causes
>> > > the second query to succeed.
>> > > On Aug 3, 11:25 am, Tobias Sebring <tsebr...@gmail.com> wrote:
>> > > > Yep. It's the culture on my maching. Add this at the top of the main
>> > > > function and the second query will fail:
>> > > > Thread.CurrentThread.CurrentCulture = new CultureInfo("sv-SE");
>> > > > On Aug 3, 11:19 am, Tobias Sebring <tsebr...@gmail.com> wrote:
>> > > > > This line is used for each of the querys:
>> > > > > var datas = q.WaitForNonStaleResults().ToList();
>> > > > > Do I need to put it further up in the query expression? The code
>> where
>> > > > > I initially experienced this issue is fully indexed with not a
>> single
>> > > > > stale index and no write operations after initial import.
>> > > > > > You don't have WaitForNonStaleResults there, it might be that
>> > > > > > On Fri, Aug 3, 2012 at 12:08 PM, Tobias Sebring <
>> tsebr...@gmail.com>
>> > > wrote:
>> > > > > > > That is odd. I have run this query many-many times and the
>> second
>> > > > > > > query have never been successful. I just ran it again on a
>> fresh
>> > > > > > > ravendb and it fails every time.
>> > > > > > > Any idea what could be causing this and/or what parameters in
>> my
>> > > > > > > environment that is not part of the solution could play a
>> part in
>> > > the
>> > > > > > > causing the query to fail?
>> > > > > > > On Aug 3, 10:46 am, "Oren Eini (Ayende Rahien)" <
>> aye...@ayende.com
>> > > > > > > > .Boost(1m): This query will succeed...
>> > > > > > > > Query returned 1 results...
>> > > > > > > > Changed to .Boost(1.5m): This query will fail...
>> > > > > > > > Query returned 1 results...
>> > > > > > > > .Boost(1.5m) but this time we match on .Search("Text",
>> name):
>> > > This query
>> > > > > > > > will su
>> > > > > > > > cceed...
>> > > > > > > > Query returned 1 results...
>> > > > > > > > Which seems to be fine.
>> > > > > > > > On Fri, Aug 3, 2012 at 11:37 AM, Tobias Sebring <
>> > > tsebr...@gmail.com>
>> > > > > > > wrote:
>> > > > > > > > > Here is a complete repro on 1.2.2055-Unstable:
>> > > > > > > > >https://dl.dropbox.com/u/6420016/DataQuery.zip
>> > > > > > > > > Query 1 will succeed due to .Boost(1m) (1m being key)
>> > > > > > > > > Query 2 will fail due to .Boost(1.5m) and matching on
>> .OrElse
>> > > > > > > > > Query 3 will succeed even though .Boost(1.5m) due to
>> matching
>> > > > > > > > > on .Where before .OrElse
>> > > > > > > > > I added another weird case in there which I would be
>> happy if
>> > > you
>> > > > > > > > > could have a look at. When using .OrElse.Not.Where(x =>
>> > > x.Type, type)
>> > > > > > > > > no match will be returned even though there is one
>> document in
>> > > the
>> > > > > > > > > index that should match this case. The code utilizes a
>> > > workaround
>> > > > > > > > > which only works when there are two Types:
>> .OrElse.Where(x =>
>> > > x.Type,
>> > > > > > > > > type == DataType.Type1 ? DataType.Type2 : DataType.Type1).
>> > > > > > > > > On Aug 3, 7:44 am, "Oren Eini (Ayende Rahien)" <
>> > > aye...@ayende.com>
>> > > > > > > > > wrote:
>> > > > > > > > > > Can you create a failing test?
>> > > > > > > > > > On Fri, Aug 3, 2012 at 2:53 AM, Tobias Sebring <
>> > > tsebr...@gmail.com>
>> > > > > > > > > wrote:
>> > > > > > > > > > > Some additional info: This only seems to happen when
>> no
>> > > results are
>> > > > > > > > > > > found for .Search("Text", text) but results are found
>> > > > > > > > > > > for .OrElse().Search("Texts", text).
>> > > > > > > > > > > On Aug 3, 1:45 am, Tobias Sebring <tsebr...@gmail.com
>> > > > > > > > > > > > As soon as I uncomment //.Boost(1.5m) the query
>> will no
>> > > longer
>> > > > > > > > > return any
>> > > > > > > > > > > > results. This is true irregardless of where i put
>> it and
>> > > also
>> > > > > > > true
>> > > > > > > > > when I
>> > > > > > > > > > > > set the same boost on both sides of the OrElse. The
>> only
>> > > boost
>> > > > > > > value
>> > > > > > > > > that
>> > > > > > > > > > > > works is 1m and I suspect that is due to it being
>> the
>> > > default
>> > > > > > > value.
>> > > > > > > > > > > > This is on 1.2.2051-Unstable.
First subquery will match "test" == "test" on .Search("Text", name).
Second subquery will not match Type1 == Type2 on .WhereEquals(x =>
x.Type, type)
Second subquery should match Type1 != Type2 on .Not.WhereEquals(x =>
x.Type, type) but it does not.
On Aug 3, 6:35 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
wrote:
> Note that in order for NOT to work, you need to have a positive side as well
> On Fri, Aug 3, 2012 at 7:34 PM, Oren Eini (Ayende Rahien) <aye...@ayende.com
> > wrote:
> > I can't follow this in pieces, can you show a full example?
> > On Fri, Aug 3, 2012 at 7:33 PM, Tobias Sebring <tsebr...@gmail.com> wrote:
> >> I mentioned another problem I'm having with the repro code in
> >> that .OrElse.Not.Where(x => x.Type, type) never returns any results.
> >> I'm using .WhereEquals(x => x.Type, type == DataType.Type1 ?
> >> DataType.Type2 : DataType.Type1) to work around this fact.
> >> Do you know if this is another bug or if I'm using .Not.WhereEquals
> >> incorrectly?
> >> The repro contains code to test this and you may
> >> uncomment .Not.WhereEquals in each of the queries to reproduce the
> >> issue:
> >> .Not.WhereEquals(x => x.Type, type) //this does not work (why?)
> >> //.WhereEquals(x => x.Type, type == DataType.Type1 ? DataType.Type2 :
> >> DataType.Type1)
> >> On Aug 3, 5:52 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> >> wrote:
> >> > No, it isn't relevant.
> >> > That is a bug, I'll fix it.
> >> > On Fri, Aug 3, 2012 at 12:34 PM, Tobias Sebring <tsebr...@gmail.com>
> >> wrote:
> >> > > I don't think the culture should be relevant in my code but I may be
> >> > > wrong? If I run the second query trying to match a English string that
> >> > > I also added to .Secondary on the document - it will still fail.
> >> > > I had a friend run the same project on his manching with the same
> >> > > result. Our default culture (sv-SE) will cause the second query to
> >> > > fail, but changing the default culture for the thread to en-US causes
> >> > > the second query to succeed.
> >> > > On Aug 3, 11:25 am, Tobias Sebring <tsebr...@gmail.com> wrote:
> >> > > > Yep. It's the culture on my maching. Add this at the top of the main
> >> > > > function and the second query will fail:
> >> > > > Thread.CurrentThread.CurrentCulture = new CultureInfo("sv-SE");
> >> > > > On Aug 3, 11:19 am, Tobias Sebring <tsebr...@gmail.com> wrote:
> >> > > > > This line is used for each of the querys:
> >> > > > > var datas = q.WaitForNonStaleResults().ToList();
> >> > > > > Do I need to put it further up in the query expression? The code
> >> where
> >> > > > > I initially experienced this issue is fully indexed with not a
> >> single
> >> > > > > stale index and no write operations after initial import.
> >> > > > > > You don't have WaitForNonStaleResults there, it might be that
> >> > > > > > On Fri, Aug 3, 2012 at 12:08 PM, Tobias Sebring <
> >> tsebr...@gmail.com>
> >> > > wrote:
> >> > > > > > > That is odd. I have run this query many-many times and the
> >> second
> >> > > > > > > query have never been successful. I just ran it again on a
> >> fresh
> >> > > > > > > ravendb and it fails every time.
> >> > > > > > > Any idea what could be causing this and/or what parameters in
> >> my
> >> > > > > > > environment that is not part of the solution could play a
> >> part in
> >> > > the
> >> > > > > > > causing the query to fail?
> >> > > > > > > > .Boost(1m): This query will succeed...
> >> > > > > > > > Query returned 1 results...
> >> > > > > > > > Changed to .Boost(1.5m): This query will fail...
> >> > > > > > > > Query returned 1 results...
> >> > > > > > > > .Boost(1.5m) but this time we match on .Search("Text",
> >> name):
> >> > > This query
> >> > > > > > > > will su
> >> > > > > > > > cceed...
> >> > > > > > > > Query returned 1 results...
> >> > > > > > > > Which seems to be fine.
> >> > > > > > > > On Fri, Aug 3, 2012 at 11:37 AM, Tobias Sebring <
> >> > > tsebr...@gmail.com>
> >> > > > > > > wrote:
> >> > > > > > > > > Here is a complete repro on 1.2.2055-Unstable:
> >> > > > > > > > >https://dl.dropbox.com/u/6420016/DataQuery.zip
> >> > > > > > > > > Query 1 will succeed due to .Boost(1m) (1m being key)
> >> > > > > > > > > Query 2 will fail due to .Boost(1.5m) and matching on
> >> .OrElse
> >> > > > > > > > > Query 3 will succeed even though .Boost(1.5m) due to
> >> matching
> >> > > > > > > > > on .Where before .OrElse
> >> > > > > > > > > I added another weird case in there which I would be
> >> happy if
> >> > > you
> >> > > > > > > > > could have a look at. When using .OrElse.Not.Where(x =>
> >> > > x.Type, type)
> >> > > > > > > > > no match will be returned even though there is one
> >> document in
> >> > > the
> >> > > > > > > > > index that should match this case. The code utilizes a
> >> > > workaround
> >> > > > > > > > > which only works when there are two Types:
> >> .OrElse.Where(x =>
> >> > > x.Type,
> >> > > > > > > > > type == DataType.Type1 ? DataType.Type2 : DataType.Type1).
> >> > > > > > > > > > > > As soon as I uncomment //.Boost(1.5m) the query
> >> will no
> >> > > longer
> >> > > > > > > > > return any
> >> > > > > > > > > > > > results. This is true irregardless of where i put
> >> it and
> >> > > also
> >> > > > > > > true
> >> > > > > > > > > when I
> >> > > > > > > > > > > > set the same boost on both sides of the OrElse. The
> >> only
> >> > > boost
> >> > > > > > > value
> >> > > > > > > > > that
> >> > > > > > > > > > > > works is 1m and I suspect that is due to it being
> >> the
> >> > > default
> >> > > > > > > value.
> >> > > > > > > > > > > > This is on 1.2.2051-Unstable.
> First subquery will match "test" == "test" on .Search("Text", name).
> Second subquery will not match Type1 == Type2 on .WhereEquals(x =>
> x.Type, type)
> Second subquery should match Type1 != Type2 on .Not.WhereEquals(x =>
> x.Type, type) but it does not.
> On Aug 3, 6:35 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> wrote:
> > Note that in order for NOT to work, you need to have a positive side as
> well
> > On Fri, Aug 3, 2012 at 7:34 PM, Oren Eini (Ayende Rahien) <
> aye...@ayende.com
> > > wrote:
> > > I can't follow this in pieces, can you show a full example?
> > > On Fri, Aug 3, 2012 at 7:33 PM, Tobias Sebring <tsebr...@gmail.com>
> wrote:
> > >> I mentioned another problem I'm having with the repro code in
> > >> that .OrElse.Not.Where(x => x.Type, type) never returns any results.
> > >> I'm using .WhereEquals(x => x.Type, type == DataType.Type1 ?
> > >> DataType.Type2 : DataType.Type1) to work around this fact.
> > >> Do you know if this is another bug or if I'm using .Not.WhereEquals
> > >> incorrectly?
> > >> The repro contains code to test this and you may
> > >> uncomment .Not.WhereEquals in each of the queries to reproduce the
> > >> issue:
> > >> .Not.WhereEquals(x => x.Type, type) //this does not work (why?)
> > >> //.WhereEquals(x => x.Type, type == DataType.Type1 ? DataType.Type2 :
> > >> DataType.Type1)
> > >> On Aug 3, 5:52 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> > >> wrote:
> > >> > No, it isn't relevant.
> > >> > That is a bug, I'll fix it.
> > >> > On Fri, Aug 3, 2012 at 12:34 PM, Tobias Sebring <tsebr...@gmail.com
> > >> wrote:
> > >> > > I don't think the culture should be relevant in my code but I may
> be
> > >> > > wrong? If I run the second query trying to match a English string
> that
> > >> > > I also added to .Secondary on the document - it will still fail.
> > >> > > I had a friend run the same project on his manching with the same
> > >> > > result. Our default culture (sv-SE) will cause the second query to
> > >> > > fail, but changing the default culture for the thread to en-US
> causes
> > >> > > the second query to succeed.
> > >> > > On Aug 3, 11:25 am, Tobias Sebring <tsebr...@gmail.com> wrote:
> > >> > > > Yep. It's the culture on my maching. Add this at the top of the
> main
> > >> > > > function and the second query will fail:
> > >> > > > Thread.CurrentThread.CurrentCulture = new CultureInfo("sv-SE");
> > >> > > > On Aug 3, 11:19 am, Tobias Sebring <tsebr...@gmail.com> wrote:
> > >> > > > > This line is used for each of the querys:
> > >> > > > > var datas = q.WaitForNonStaleResults().ToList();
> > >> > > > > Do I need to put it further up in the query expression? The
> code
> > >> where
> > >> > > > > I initially experienced this issue is fully indexed with not a
> > >> single
> > >> > > > > stale index and no write operations after initial import.
> > >> > > > > Could it be a culture issue or such?
> > >> > > > > > You don't have WaitForNonStaleResults there, it might be
> that
> > >> > > > > > On Fri, Aug 3, 2012 at 12:08 PM, Tobias Sebring <
> > >> tsebr...@gmail.com>
> > >> > > wrote:
> > >> > > > > > > That is odd. I have run this query many-many times and the
> > >> second
> > >> > > > > > > query have never been successful. I just ran it again on a
> > >> fresh
> > >> > > > > > > ravendb and it fails every time.
> > >> > > > > > > Any idea what could be causing this and/or what
> parameters in
> > >> my
> > >> > > > > > > environment that is not part of the solution could play a
> > >> part in
> > >> > > the
> > >> > > > > > > causing the query to fail?
> > >> > > > > > > > .Boost(1m): This query will succeed...
> > >> > > > > > > > Query returned 1 results...
> > >> > > > > > > > Changed to .Boost(1.5m): This query will fail...
> > >> > > > > > > > Query returned 1 results...
> > >> > > > > > > > .Boost(1.5m) but this time we match on .Search("Text",
> > >> name):
> > >> > > This query
> > >> > > > > > > > will su
> > >> > > > > > > > cceed...
> > >> > > > > > > > Query returned 1 results...
> > >> > > > > > > > Which seems to be fine.
> > >> > > > > > > > On Fri, Aug 3, 2012 at 11:37 AM, Tobias Sebring <
> > >> > > tsebr...@gmail.com>
> > >> > > > > > > wrote:
> > >> > > > > > > > > Here is a complete repro on 1.2.2055-Unstable:
> > >> > > > > > > > >https://dl.dropbox.com/u/6420016/DataQuery.zip
> > >> > > > > > > > > Query 1 will succeed due to .Boost(1m) (1m being key)
> > >> > > > > > > > > Query 2 will fail due to .Boost(1.5m) and matching on
> > >> .OrElse
> > >> > > > > > > > > Query 3 will succeed even though .Boost(1.5m) due to
> > >> matching
> > >> > > > > > > > > on .Where before .OrElse
> > >> > > > > > > > > I added another weird case in there which I would be
> > >> happy if
> > >> > > you
> > >> > > > > > > > > could have a look at. When using .OrElse.Not.Where(x
> =>
> > >> > > x.Type, type)
> > >> > > > > > > > > no match will be returned even though there is one
> > >> document in
> > >> > > the
> > >> > > > > > > > > index that should match this case. The code utilizes a
> > >> > > workaround
> > >> > > > > > > > > which only works when there are two Types:
> > >> .OrElse.Where(x =>
> > >> > > x.Type,
> > >> > > > > > > > > type == DataType.Type1 ? DataType.Type2 :
> DataType.Type1).
I see. Do you have any recommendation on how I could set up my query
when I wish to boost the score of one particular type but include all
types in the result?
Match everything but boost score if type equal x.
On Aug 3, 10:02 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
wrote:
> > First subquery will match "test" == "test" on .Search("Text", name).
> > Second subquery will not match Type1 == Type2 on .WhereEquals(x =>
> > x.Type, type)
> > Second subquery should match Type1 != Type2 on .Not.WhereEquals(x =>
> > x.Type, type) but it does not.
> > On Aug 3, 6:35 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> > wrote:
> > > Note that in order for NOT to work, you need to have a positive side as
> > well
> > > On Fri, Aug 3, 2012 at 7:34 PM, Oren Eini (Ayende Rahien) <
> > aye...@ayende.com
> > > > wrote:
> > > > I can't follow this in pieces, can you show a full example?
> > > > On Fri, Aug 3, 2012 at 7:33 PM, Tobias Sebring <tsebr...@gmail.com>
> > wrote:
> > > >> I mentioned another problem I'm having with the repro code in
> > > >> that .OrElse.Not.Where(x => x.Type, type) never returns any results.
> > > >> I'm using .WhereEquals(x => x.Type, type == DataType.Type1 ?
> > > >> DataType.Type2 : DataType.Type1) to work around this fact.
> > > >> Do you know if this is another bug or if I'm using .Not.WhereEquals
> > > >> incorrectly?
> > > >> The repro contains code to test this and you may
> > > >> uncomment .Not.WhereEquals in each of the queries to reproduce the
> > > >> issue:
> > > >> .Not.WhereEquals(x => x.Type, type) //this does not work (why?)
> > > >> //.WhereEquals(x => x.Type, type == DataType.Type1 ? DataType.Type2 :
> > > >> DataType.Type1)
> > > >> On Aug 3, 5:52 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> > > >> wrote:
> > > >> > No, it isn't relevant.
> > > >> > That is a bug, I'll fix it.
> > > >> > On Fri, Aug 3, 2012 at 12:34 PM, Tobias Sebring <tsebr...@gmail.com
> > > >> wrote:
> > > >> > > I don't think the culture should be relevant in my code but I may
> > be
> > > >> > > wrong? If I run the second query trying to match a English string
> > that
> > > >> > > I also added to .Secondary on the document - it will still fail.
> > > >> > > I had a friend run the same project on his manching with the same
> > > >> > > result. Our default culture (sv-SE) will cause the second query to
> > > >> > > fail, but changing the default culture for the thread to en-US
> > causes
> > > >> > > the second query to succeed.
> > > >> > > On Aug 3, 11:25 am, Tobias Sebring <tsebr...@gmail.com> wrote:
> > > >> > > > Yep. It's the culture on my maching. Add this at the top of the
> > main
> > > >> > > > function and the second query will fail:
> > > >> > > > Thread.CurrentThread.CurrentCulture = new CultureInfo("sv-SE");
> > > >> > > > On Aug 3, 11:19 am, Tobias Sebring <tsebr...@gmail.com> wrote:
> > > >> > > > > This line is used for each of the querys:
> > > >> > > > > var datas = q.WaitForNonStaleResults().ToList();
> > > >> > > > > Do I need to put it further up in the query expression? The
> > code
> > > >> where
> > > >> > > > > I initially experienced this issue is fully indexed with not a
> > > >> single
> > > >> > > > > stale index and no write operations after initial import.
> > > >> > > > > Could it be a culture issue or such?
> > > >> > > > > > You don't have WaitForNonStaleResults there, it might be
> > that
> > > >> > > > > > On Fri, Aug 3, 2012 at 12:08 PM, Tobias Sebring <
> > > >> tsebr...@gmail.com>
> > > >> > > wrote:
> > > >> > > > > > > That is odd. I have run this query many-many times and the
> > > >> second
> > > >> > > > > > > query have never been successful. I just ran it again on a
> > > >> fresh
> > > >> > > > > > > ravendb and it fails every time.
> > > >> > > > > > > Any idea what could be causing this and/or what
> > parameters in
> > > >> my
> > > >> > > > > > > environment that is not part of the solution could play a
> > > >> part in
> > > >> > > the
> > > >> > > > > > > causing the query to fail?
> > > >> > > > > > > > > Query 1 will succeed due to .Boost(1m) (1m being key)
> > > >> > > > > > > > > Query 2 will fail due to .Boost(1.5m) and matching on
> > > >> .OrElse
> > > >> > > > > > > > > Query 3 will succeed even though .Boost(1.5m) due to
> > > >> matching
> > > >> > > > > > > > > on .Where before .OrElse
> > > >> > > > > > > > > I added another weird case in there which I would be
> > > >> happy if
> > > >> > > you
> > > >> > > > > > > > > could have a look at. When using .OrElse.Not.Where(x
> > =>
> > > >> > > x.Type, type)
> > > >> > > > > > > > > no match will be returned even though there is one
> > > >> document in
> > > >> > > the
> > > >> > > > > > > > > index that should match this case. The code utilizes a
> > > >> > > workaround
> > > >> > > > > > > > > which only works when there are two Types:
> > > >> .OrElse.Where(x =>
> > > >> > > x.Type,
> > > >> > > > > > > > > type == DataType.Type1 ? DataType.Type2 :
> > DataType.Type1).
On Fri, Aug 3, 2012 at 11:12 PM, Tobias Sebring <tsebr...@gmail.com> wrote:
> I see. Do you have any recommendation on how I could set up my query
> when I wish to boost the score of one particular type but include all
> types in the result?
> Match everything but boost score if type equal x.
> On Aug 3, 10:02 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> wrote:
> > This is expected.
> > Not is based on doing a set not, which means that if the other side is
> > empty, you get empty result.
> > > First subquery will match "test" == "test" on .Search("Text", name).
> > > Second subquery will not match Type1 == Type2 on .WhereEquals(x =>
> > > x.Type, type)
> > > Second subquery should match Type1 != Type2 on .Not.WhereEquals(x =>
> > > x.Type, type) but it does not.
> > > On Aug 3, 6:35 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> > > wrote:
> > > > Note that in order for NOT to work, you need to have a positive side
> as
> > > well
> > > > On Fri, Aug 3, 2012 at 7:34 PM, Oren Eini (Ayende Rahien) <
> > > aye...@ayende.com
> > > > > wrote:
> > > > > I can't follow this in pieces, can you show a full example?
> > > > > On Fri, Aug 3, 2012 at 7:33 PM, Tobias Sebring <tsebr...@gmail.com
> > > wrote:
> > > > >> I mentioned another problem I'm having with the repro code in
> > > > >> that .OrElse.Not.Where(x => x.Type, type) never returns any
> results.
> > > > >> I'm using .WhereEquals(x => x.Type, type == DataType.Type1 ?
> > > > >> DataType.Type2 : DataType.Type1) to work around this fact.
> > > > >> Do you know if this is another bug or if I'm using
> .Not.WhereEquals
> > > > >> incorrectly?
> > > > >> The repro contains code to test this and you may
> > > > >> uncomment .Not.WhereEquals in each of the queries to reproduce the
> > > > >> issue:
> > > > >> .Not.WhereEquals(x => x.Type, type) //this does not work (why?)
> > > > >> //.WhereEquals(x => x.Type, type == DataType.Type1 ?
> DataType.Type2 :
> > > > >> DataType.Type1)
> > > > >> On Aug 3, 5:52 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com
> > > > >> wrote:
> > > > >> > No, it isn't relevant.
> > > > >> > That is a bug, I'll fix it.
> > > > >> > On Fri, Aug 3, 2012 at 12:34 PM, Tobias Sebring <
> tsebr...@gmail.com
> > > > >> wrote:
> > > > >> > > I don't think the culture should be relevant in my code but I
> may
> > > be
> > > > >> > > wrong? If I run the second query trying to match a English
> string
> > > that
> > > > >> > > I also added to .Secondary on the document - it will still
> fail.
> > > > >> > > I had a friend run the same project on his manching with the
> same
> > > > >> > > result. Our default culture (sv-SE) will cause the second
> query to
> > > > >> > > fail, but changing the default culture for the thread to en-US
> > > causes
> > > > >> > > the second query to succeed.
> > > > >> > > On Aug 3, 11:25 am, Tobias Sebring <tsebr...@gmail.com>
> wrote:
> > > > >> > > > Yep. It's the culture on my maching. Add this at the top of
> the
> > > main
> > > > >> > > > function and the second query will fail:
> > > > >> > > > Thread.CurrentThread.CurrentCulture = new
> CultureInfo("sv-SE");
> > > > >> > > > On Aug 3, 11:19 am, Tobias Sebring <tsebr...@gmail.com>
> wrote:
> > > > >> > > > > This line is used for each of the querys:
> > > > >> > > > > var datas = q.WaitForNonStaleResults().ToList();
> > > > >> > > > > Do I need to put it further up in the query expression?
> The
> > > code
> > > > >> where
> > > > >> > > > > I initially experienced this issue is fully indexed with
> not a
> > > > >> single
> > > > >> > > > > stale index and no write operations after initial import.
> > > > >> > > > > Could it be a culture issue or such?
> > > > >> > > > > > You don't have WaitForNonStaleResults there, it might be
> > > that
> > > > >> > > > > > On Fri, Aug 3, 2012 at 12:08 PM, Tobias Sebring <
> > > > >> tsebr...@gmail.com>
> > > > >> > > wrote:
> > > > >> > > > > > > That is odd. I have run this query many-many times
> and the
> > > > >> second
> > > > >> > > > > > > query have never been successful. I just ran it again
> on a
> > > > >> fresh
> > > > >> > > > > > > ravendb and it fails every time.
> > > > >> > > > > > > Any idea what could be causing this and/or what
> > > parameters in
> > > > >> my
> > > > >> > > > > > > environment that is not part of the solution could
> play a
> > > > >> part in
> > > > >> > > the
> > > > >> > > > > > > causing the query to fail?
> > > > >> > > > > > > > > Query 1 will succeed due to .Boost(1m) (1m being
> key)
> > > > >> > > > > > > > > Query 2 will fail due to .Boost(1.5m) and
> matching on
> > > > >> .OrElse
> > > > >> > > > > > > > > Query 3 will succeed even though .Boost(1.5m) due
> to
> > > > >> matching
> > > > >> > > > > > > > > on .Where before .OrElse
> > > > >> > > > > > > > > I added another weird case in there which I would
> be
> > > > >> happy if
> > > > >> > > you
> > > > >> > > > > > > > > could have a look at. When using
> .OrElse.Not.Where(x
> > > =>
> > > > >> > > x.Type, type)
> > > > >> > > > > > > > > no match will be returned even though there is one
> > > > >> document in
> > > > >> > > the
> > > > >> > > > > > > > > index that should match this case. The code
> utilizes a
> > > > >> > > workaround
> > > > >> > > > > > > > > which only works when there are two Types:
> > > > >> .OrElse.Where(x =>
> > > > >> > > x.Type,
> > > > >> > > > > > > > > type == DataType.Type1 ? DataType.Type2 :
> > > DataType.Type1).
> On Fri, Aug 3, 2012 at 11:12 PM, Tobias Sebring <tsebr...@gmail.com> wrote:
> > I see. Do you have any recommendation on how I could set up my query
> > when I wish to boost the score of one particular type but include all
> > types in the result?
> > Match everything but boost score if type equal x.
> > On Aug 3, 10:02 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> > wrote:
> > > This is expected.
> > > Not is based on doing a set not, which means that if the other side is
> > > empty, you get empty result.
> > > > First subquery will match "test" == "test" on .Search("Text", name).
> > > > Second subquery will not match Type1 == Type2 on .WhereEquals(x =>
> > > > x.Type, type)
> > > > Second subquery should match Type1 != Type2 on .Not.WhereEquals(x =>
> > > > x.Type, type) but it does not.
> > > > On Aug 3, 6:35 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> > > > wrote:
> > > > > Note that in order for NOT to work, you need to have a positive side
> > as
> > > > well
> > > > > On Fri, Aug 3, 2012 at 7:34 PM, Oren Eini (Ayende Rahien) <
> > > > aye...@ayende.com
> > > > > > wrote:
> > > > > > I can't follow this in pieces, can you show a full example?
> > > > > > On Fri, Aug 3, 2012 at 7:33 PM, Tobias Sebring <tsebr...@gmail.com
> > > > wrote:
> > > > > >> I mentioned another problem I'm having with the repro code in
> > > > > >> that .OrElse.Not.Where(x => x.Type, type) never returns any
> > results.
> > > > > >> I'm using .WhereEquals(x => x.Type, type == DataType.Type1 ?
> > > > > >> DataType.Type2 : DataType.Type1) to work around this fact.
> > > > > >> Do you know if this is another bug or if I'm using
> > .Not.WhereEquals
> > > > > >> incorrectly?
> > > > > >> The repro contains code to test this and you may
> > > > > >> uncomment .Not.WhereEquals in each of the queries to reproduce the
> > > > > >> issue:
> > > > > >> .Not.WhereEquals(x => x.Type, type) //this does not work (why?)
> > > > > >> //.WhereEquals(x => x.Type, type == DataType.Type1 ?
> > DataType.Type2 :
> > > > > >> DataType.Type1)
> > > > > >> On Aug 3, 5:52 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com
> > > > > >> wrote:
> > > > > >> > No, it isn't relevant.
> > > > > >> > That is a bug, I'll fix it.
> > > > > >> > On Fri, Aug 3, 2012 at 12:34 PM, Tobias Sebring <
> > tsebr...@gmail.com
> > > > > >> wrote:
> > > > > >> > > I don't think the culture should be relevant in my code but I
> > may
> > > > be
> > > > > >> > > wrong? If I run the second query trying to match a English
> > string
> > > > that
> > > > > >> > > I also added to .Secondary on the document - it will still
> > fail.
> > > > > >> > > I had a friend run the same project on his manching with the
> > same
> > > > > >> > > result. Our default culture (sv-SE) will cause the second
> > query to
> > > > > >> > > fail, but changing the default culture for the thread to en-US
> > > > causes
> > > > > >> > > the second query to succeed.
> > > > > >> > > On Aug 3, 11:25 am, Tobias Sebring <tsebr...@gmail.com>
> > wrote:
> > > > > >> > > > Yep. It's the culture on my maching. Add this at the top of
> > the
> > > > main
> > > > > >> > > > function and the second query will fail:
> > > > > >> > > > Thread.CurrentThread.CurrentCulture = new
> > CultureInfo("sv-SE");
> > > > > >> > > > On Aug 3, 11:19 am, Tobias Sebring <tsebr...@gmail.com>
> > wrote:
> > > > > >> > > > > This line is used for each of the querys:
> > > > > >> > > > > var datas = q.WaitForNonStaleResults().ToList();
> > > > > >> > > > > Do I need to put it further up in the query expression?
> > The
> > > > code
> > > > > >> where
> > > > > >> > > > > I initially experienced this issue is fully indexed with
> > not a
> > > > > >> single
> > > > > >> > > > > stale index and no write operations after initial import.
> > > > > >> > > > > Could it be a culture issue or such?
> > > > > >> > > > > > You don't have WaitForNonStaleResults there, it might be
> > > > that
> > > > > >> > > > > > On Fri, Aug 3, 2012 at 12:08 PM, Tobias Sebring <
> > > > > >> tsebr...@gmail.com>
> > > > > >> > > wrote:
> > > > > >> > > > > > > That is odd. I have run this query many-many times
> > and the
> > > > > >> second
> > > > > >> > > > > > > query have never been successful. I just ran it again
> > on a
> > > > > >> fresh
> > > > > >> > > > > > > ravendb and it fails every time.
> > > > > >> > > > > > > Any idea what could be causing this and/or what
> > > > parameters in
> > > > > >> my
> > > > > >> > > > > > > environment that is not part of the solution could
> > play a
> > > > > >> part in
> > > > > >> > > the
> > > > > >> > > > > > > causing the query to fail?
On Fri, Aug 3, 2012 at 11:41 PM, Tobias Sebring <tsebr...@gmail.com> wrote:
> This is what I have been doing - but what if Type is an enum that has
> five or ten different values?
> > On Fri, Aug 3, 2012 at 11:12 PM, Tobias Sebring <tsebr...@gmail.com>
> wrote:
> > > I see. Do you have any recommendation on how I could set up my query
> > > when I wish to boost the score of one particular type but include all
> > > types in the result?
> > > Match everything but boost score if type equal x.
> > > On Aug 3, 10:02 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> > > wrote:
> > > > This is expected.
> > > > Not is based on doing a set not, which means that if the other side
> is
> > > > empty, you get empty result.
> > > > > First subquery will match "test" == "test" on .Search("Text",
> name).
> > > > > Second subquery will not match Type1 == Type2 on .WhereEquals(x =>
> > > > > x.Type, type)
> > > > > Second subquery should match Type1 != Type2 on .Not.WhereEquals(x
> =>
> > > > > x.Type, type) but it does not.
> > > > > On Aug 3, 6:35 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> > > > > wrote:
> > > > > > Note that in order for NOT to work, you need to have a positive
> side
> > > as
> > > > > well
> > > > > > On Fri, Aug 3, 2012 at 7:34 PM, Oren Eini (Ayende Rahien) <
> > > > > aye...@ayende.com
> > > > > > > wrote:
> > > > > > > I can't follow this in pieces, can you show a full example?
> > > > > > > On Fri, Aug 3, 2012 at 7:33 PM, Tobias Sebring <
> tsebr...@gmail.com
> > > > > wrote:
> > > > > > >> I mentioned another problem I'm having with the repro code in
> > > > > > >> that .OrElse.Not.Where(x => x.Type, type) never returns any
> > > results.
> > > > > > >> I'm using .WhereEquals(x => x.Type, type == DataType.Type1 ?
> > > > > > >> DataType.Type2 : DataType.Type1) to work around this fact.
> > > > > > >> Do you know if this is another bug or if I'm using
> > > .Not.WhereEquals
> > > > > > >> incorrectly?
> > > > > > >> The repro contains code to test this and you may
> > > > > > >> uncomment .Not.WhereEquals in each of the queries to
> reproduce the
> > > > > > >> issue:
> > > > > > >> .Not.WhereEquals(x => x.Type, type) //this does not work
> (why?)
> > > > > > >> //.WhereEquals(x => x.Type, type == DataType.Type1 ?
> > > DataType.Type2 :
> > > > > > >> DataType.Type1)
> > > > > > >> On Aug 3, 5:52 pm, "Oren Eini (Ayende Rahien)" <
> aye...@ayende.com
> > > > > > >> wrote:
> > > > > > >> > No, it isn't relevant.
> > > > > > >> > That is a bug, I'll fix it.
> > > > > > >> > On Fri, Aug 3, 2012 at 12:34 PM, Tobias Sebring <
> > > tsebr...@gmail.com
> > > > > > >> wrote:
> > > > > > >> > > I don't think the culture should be relevant in my code
> but I
> > > may
> > > > > be
> > > > > > >> > > wrong? If I run the second query trying to match a English
> > > string
> > > > > that
> > > > > > >> > > I also added to .Secondary on the document - it will still
> > > fail.
> > > > > > >> > > I had a friend run the same project on his manching with
> the
> > > same
> > > > > > >> > > result. Our default culture (sv-SE) will cause the second
> > > query to
> > > > > > >> > > fail, but changing the default culture for the thread to
> en-US
> > > > > causes
> > > > > > >> > > the second query to succeed.
> > > > > > >> > > On Aug 3, 11:25 am, Tobias Sebring <tsebr...@gmail.com>
> > > wrote:
> > > > > > >> > > > Yep. It's the culture on my maching. Add this at the
> top of
> > > the
> > > > > main
> > > > > > >> > > > function and the second query will fail:
> > > > > > >> > > > Thread.CurrentThread.CurrentCulture = new
> > > CultureInfo("sv-SE");
> > > > > > >> > > > > This line is used for each of the querys:
> > > > > > >> > > > > var datas = q.WaitForNonStaleResults().ToList();
> > > > > > >> > > > > Do I need to put it further up in the query
> expression?
> > > The
> > > > > code
> > > > > > >> where
> > > > > > >> > > > > I initially experienced this issue is fully indexed
> with
> > > not a
> > > > > > >> single
> > > > > > >> > > > > stale index and no write operations after initial
> import.
> > > > > > >> > > > > Could it be a culture issue or such?
> > > > > > >> > > > > > You don't have WaitForNonStaleResults there, it
> might be
> > > > > that
> > > > > > >> > > > > > On Fri, Aug 3, 2012 at 12:08 PM, Tobias Sebring <
> > > > > > >> tsebr...@gmail.com>
> > > > > > >> > > wrote:
> > > > > > >> > > > > > > That is odd. I have run this query many-many times
> > > and the
> > > > > > >> second
> > > > > > >> > > > > > > query have never been successful. I just ran it
> again
> > > on a
> > > > > > >> fresh
> > > > > > >> > > > > > > ravendb and it fails every time.
> > > > > > >> > > > > > > Any idea what could be causing this and/or what
> > > > > parameters in
> > > > > > >> my
> > > > > > >> > > > > > > environment that is not part of the solution could
> > > play a
> > > > > > >> part in
> > > > > > >> > > the
> > > > > > >> > > > > > > causing the query to fail?
> And you can for just one of them?
> WhereEquals("Type", "one").Boost(1.5)
> .WhereEquals("Type", "*")
> This would match any value.
> On Fri, Aug 3, 2012 at 11:41 PM, Tobias Sebring <tsebr...@gmail.com> wrote:
> > This is what I have been doing - but what if Type is an enum that has
> > five or ten different values?
> > > On Fri, Aug 3, 2012 at 11:12 PM, Tobias Sebring <tsebr...@gmail.com>
> > wrote:
> > > > I see. Do you have any recommendation on how I could set up my query
> > > > when I wish to boost the score of one particular type but include all
> > > > types in the result?
> > > > Match everything but boost score if type equal x.
> > > > On Aug 3, 10:02 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> > > > wrote:
> > > > > This is expected.
> > > > > Not is based on doing a set not, which means that if the other side
> > is
> > > > > empty, you get empty result.
> > > > > > First subquery will match "test" == "test" on .Search("Text",
> > name).
> > > > > > Second subquery will not match Type1 == Type2 on .WhereEquals(x =>
> > > > > > x.Type, type)
> > > > > > Second subquery should match Type1 != Type2 on .Not.WhereEquals(x
> > =>
> > > > > > x.Type, type) but it does not.
> > > > > > On Aug 3, 6:35 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
> > > > > > wrote:
> > > > > > > Note that in order for NOT to work, you need to have a positive
> > side
> > > > as
> > > > > > well
> > > > > > > On Fri, Aug 3, 2012 at 7:34 PM, Oren Eini (Ayende Rahien) <
> > > > > > aye...@ayende.com
> > > > > > > > wrote:
> > > > > > > > I can't follow this in pieces, can you show a full example?
> > > > > > > > On Fri, Aug 3, 2012 at 7:33 PM, Tobias Sebring <
> > tsebr...@gmail.com
> > > > > > wrote:
> > > > > > > >> I mentioned another problem I'm having with the repro code in
> > > > > > > >> that .OrElse.Not.Where(x => x.Type, type) never returns any
> > > > results.
> > > > > > > >> I'm using .WhereEquals(x => x.Type, type == DataType.Type1 ?
> > > > > > > >> DataType.Type2 : DataType.Type1) to work around this fact.
> > > > > > > >> Do you know if this is another bug or if I'm using
> > > > .Not.WhereEquals
> > > > > > > >> incorrectly?
> > > > > > > >> The repro contains code to test this and you may
> > > > > > > >> uncomment .Not.WhereEquals in each of the queries to
> > reproduce the
> > > > > > > >> issue:
> > > > > > > >> .Not.WhereEquals(x => x.Type, type) //this does not work
> > (why?)
> > > > > > > >> //.WhereEquals(x => x.Type, type == DataType.Type1 ?
> > > > DataType.Type2 :
> > > > > > > >> DataType.Type1)
> > > > > > > >> wrote:
> > > > > > > >> > No, it isn't relevant.
> > > > > > > >> > That is a bug, I'll fix it.
> > > > > > > >> > On Fri, Aug 3, 2012 at 12:34 PM, Tobias Sebring <
> > > > tsebr...@gmail.com
> > > > > > > >> wrote:
> > > > > > > >> > > I don't think the culture should be relevant in my code
> > but I
> > > > may
> > > > > > be
> > > > > > > >> > > wrong? If I run the second query trying to match a English
> > > > string
> > > > > > that
> > > > > > > >> > > I also added to .Secondary on the document - it will still
> > > > fail.
> > > > > > > >> > > I had a friend run the same project on his manching with
> > the
> > > > same
> > > > > > > >> > > result. Our default culture (sv-SE) will cause the second
> > > > query to
> > > > > > > >> > > fail, but changing the default culture for the thread to
> > en-US
> > > > > > causes
> > > > > > > >> > > the second query to succeed.
> > > > > > > >> > > On Aug 3, 11:25 am, Tobias Sebring <tsebr...@gmail.com>
> > > > wrote:
> > > > > > > >> > > > Yep. It's the culture on my maching. Add this at the
> > top of
> > > > the
> > > > > > main
> > > > > > > >> > > > function and the second query will fail:
> > > > > > > >> > > > Thread.CurrentThread.CurrentCulture = new
> > > > CultureInfo("sv-SE");
> > > > > > > >> > > > > This line is used for each of the querys:
> > > > > > > >> > > > > var datas = q.WaitForNonStaleResults().ToList();
> > > > > > > >> > > > > Do I need to put it further up in the query
> > expression?
> > > > The
> > > > > > code
> > > > > > > >> where
> > > > > > > >> > > > > I initially experienced this issue is fully indexed
> > with
> > > > not a
> > > > > > > >> single
> > > > > > > >> > > > > stale index and no write operations after initial
> > import.
> > > > > > > >> > > > > Could it be a culture issue or such?
> > > > > > > >> > > > > > You don't have WaitForNonStaleResults there, it
> > might be
> > > > > > that
> > > > > > > >> > > > > > On Fri, Aug 3, 2012 at 12:08 PM, Tobias Sebring <
> > > > > > > >> tsebr...@gmail.com>
> > > > > > > >> > > wrote:
> > > > > > > >> > > > > > > That is odd. I have run this query many-many times
> > > > and the
> > > > > > > >> second
> > > > > > > >> > > > > > > query have never been successful. I just ran it
> > again
> > > > on a
> > > > > > > >> fresh
> > > > > > > >> > > > > > > ravendb and it fails every time.
> > > > > > > >> > > > > > > Any idea what could be causing this and/or what
> > > > > > parameters in
> > > > > > > >> my
> > > > > > > >> > > > > > > environment that is not part of the solution could
> > > > play a
> > > > > > > >> part in
> > > > > > > >> > > the
> > > > > > > >> > > > > > > causing the query to fail?