Parameters:
Documents = [
{ Text = "test", Type = Type1 }
];
name = "test";
type = Type2;
Query:
var q = session.Advanced.LuceneQuery<Data, Data_Search>()
.UsingDefaultOperator(QueryOperator.And)
.OpenSubclause()
.Search("Text", name)
.Boost(2m)
.OrElse()
.Search("Texts", name)
.CloseSubclause()
.OpenSubclause()
.WhereEquals(x => x.Type, type)
.Boost(1.5m)
.OrElse()
.Not.WhereEquals(x => x.Type, type)
.CloseSubclause();
.WaitForNonStaleResults()
.ToList();
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?
>