【发布时间】:2016-07-12 23:54:19
【问题描述】:
我想在索引中使用几个正则表达式。这是一个简化的例子:
Map =
books =>
books.Select(x => new {Sentences = Regex.Split(x.Description, "<br>")})
.Select(x => new {Results = x.Sentences.Where(y => Regex.IsMatch(y, "foo"))})
.Where(x => x.Results.Any())
.Select(x => new {});
但是,会抛出以下异常:
An exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred in System.Core.dll but was not handled in user code
Additional information: 'System.Array' does not contain a definition for 'Where'
我试过 .AsEnumerable() 但无济于事。这个可以吗?
【问题讨论】:
-
RavenDB 为您提供全文索引,可以将句子拆分为单词。只列出句子并让 Lucene 引擎为您做这件事会更有用吗?
标签: ravendb