C# RavenDB搜索扩展方法
此测试失败(使用raven db扩展方法搜索,允许多个参数):C# RavenDB搜索扩展方法,c#,linq,ravendb,C#,Linq,Ravendb,此测试失败(使用raven db扩展方法搜索,允许多个参数): Db.Query() .Search(r=>r.Value,“我的测试字符串”) .Count()应()为(1); 通过(使用标准,其中): Db.Query() .Where(r=>r.Value.Equals(“我的测试字符串”)) .Count()应()为(1); 为什么??它应该根据你的关键字搜索索引做什么?第二个参数是什么?您可能只是从Query()中得到了一个空集合。您是否在关键字sarchindex.Value字符
Db.Query()
.Search(r=>r.Value,“我的测试字符串”)
.Count()应()为(1);
通过(使用标准,其中):
Db.Query()
.Where(r=>r.Value.Equals(“我的测试字符串”))
.Count()应()为(1);
为什么??它应该根据你的
关键字搜索索引做什么?第二个参数是什么?您可能只是从Query()
中得到了一个空集合。您是否在关键字sarchindex.Value
字符串上定义了索引,以指示它已被分析?
Db.Query<KeywordsSearchIndex.Result, KeywordsSearchIndex>()
.Search(r => r.Value, "My Test String")
.Count().Should().Be(1);
Db.Query<KeywordsSearchIndex.Result, KeywordsSearchIndex>()
.Where(r => r.Value.Equals("My Test String"))
.Count().Should().Be(1);