Created
February 28, 2013 12:45
-
-
Save pkrakowiak/5056490 to your computer and use it in GitHub Desktop.
AND operator doesn't seem to be working in RavenDB Client. Details: https://groups.google.com/forum/?fromgroups=#!topic/ravendb/vU61Qh6j0o4
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
using Raven.Abstractions.Data; | |
using Raven.Tests.Helpers; | |
using Xunit; | |
namespace LuceneAnd.RavenTests | |
{ | |
public class CanUseAndOperatorOnLuceneQuery : RavenTestBase | |
{ | |
private class Place | |
{ | |
public string Name { get; set; } | |
public string Descriptionn { get; set; } | |
} | |
[Fact] | |
public void WillUseAndOperator() | |
{ | |
using (var store = NewDocumentStore()) | |
{ | |
using (var session = store.OpenSession()) | |
{ | |
var keywords = "state museum"; | |
var query = session.Advanced.LuceneQuery<Place>() | |
.Search(x => x.Name, keywords).Boost(2) | |
.Search(x => x.Descriptionn, keywords) | |
.UsingDefaultOperator(QueryOperator.And); | |
Assert.Equal("Name:(state AND museum)^2 Description:(state AND museum)", query.ToString()); | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment