C# 如何从Ignite进行文本查询
我有以下代码C# 如何从Ignite进行文本查询,c#,sql,ignite,C#,Sql,Ignite,我有以下代码 public IImmutableList<T> Find<T>(string text) where T : class, new() { IImmutableList<T> ret = new List<T>(0).ToImmutableList() as IImmutableList<T>; var (name, _) = Utility.GetDatasetAttributes<T>(
public IImmutableList<T> Find<T>(string text) where T : class, new()
{
IImmutableList<T> ret = new List<T>(0).ToImmutableList() as IImmutableList<T>;
var (name, _) = Utility.GetDatasetAttributes<T>();
var cache = _client.GetCache<Guid, T>(name);
var textQuery = new TextQuery(typeof(FinancialGroup), text);
var data = cache.Query(textQuery)
.GetAll()
.Select(x => x.Value)
.ToImmutableList<T>() as IImmutableList<T>;
ret = data;
return ret;
}
但它根本无法编译,尽管我遵循了这里给出的说明:
有什么错误?无法将textQuery传递给Query()。它需要ScanQuery()、FieldQuery()或其他,但不需要TextQuery()。尽管我提到的链接明确表示我可以通过,但这是不可能的。有什么办法吗?很奇怪,
Query()
接受QueryBase
和TextQuery
是QueryBase
。你能提供一个错误的屏幕截图吗?
public class FinancialGroup: ICacheRow //,IBinarizable
{
[QuerySqlField(IsIndexed = true)] public Guid RowKey => Key;
public Guid Key { get; set; }
[QuerySqlField(IsIndexed= true), QueryTextField()] public string Name { get; set; }
[QuerySqlField(IsIndexed= true)] public int Type { get; set; }
[QuerySqlField(IsIndexed= true), QueryTextField()] public string Number { get; set; }
[QuerySqlField(IsIndexed= true)] public Guid ImageKey { get; set; }
[QuerySqlField()] public DateTime CreatedOn { get; set; }
[QuerySqlField()] public DateTime ModifiedOn { get; set; }
}