Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/linq/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# RavenDB搜索扩展方法_C#_Linq_Ravendb - Fatal编程技术网

C# RavenDB搜索扩展方法

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字符

此测试失败(使用raven db扩展方法搜索,允许多个参数):

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);