如果我在搜索框“ Select *”中输入此文本(它可以是带有特殊字符和空格之间的任何单词),我在剃刀视图的这一行会收到此错误“提供的字符串为空或空”: var terms = searchTerm.Split(' ').Select(x => x.MultipleCharacterWildcard()).ToArray();
这是我的代码的一部分:
if (searchTerm.Contains(" "))
{
var terms = searchTerm.Split(' ').Select(x => x.MultipleCharacterWildcard()).ToArray();
//Search limited to 4 terms: ref maxClauseCount is set to 1024
if (terms.Length > 4)
{
searchError = true;
}
else
{
examineQuery.And().GroupedOr(new List<string> { "contents" }, terms);
}
}
else
{
examineQuery.And().GroupedOr(new List<string> { "contents" }, searchTerm.MultipleCharacterWildcard());
}