In fact, my query works if I add AndAlso() clause
var query = session.Advanced.LuceneQuery<object>()
.WhereEquals("@metadata.Raven-Entity-Name",
documentStore.Conventions.GetTypeTagName(_modelType))
.AndAlso()
.Where(string.Format("{0}:{1} AND NOT {2}:{3}",
_fieldName, value.ToString(), _pkFieldName, keyValue));
For example if I do this
var query = session.Advanced.LuceneQuery<object>()
.WhereEquals("@metadata.Raven-Entity-Name",
documentStore.Conventions.GetTypeTagName(_modelType)).WhereEquals("MyField",
"SomeValue")
only the first WhereEqual is being applied.
@ayende: is this the supposed behavior?
On Jul 1, 12:48 pm, Matt Warren <
mattd...@gmail.com> wrote:
> I think you need to leave out the "AND", try
> "Name:xpto NOT Id:1234"
>
> Seehttp://
lucene.apache.org/java/2_4_0/queryparsersyntax.html#NOT