ale*_*eha 3 c# .net-core ignite
使用Apache Ignite .NET 2.3.0尝试使用Linq扩展(Apache.Ignite.Linq)进行搜索.
组态:
CacheConfiguration = new[]
{
new CacheConfiguration
{
QueryEntities = new []
{
new QueryEntity(typeof(string), typeof(SecuritiesItem))
{
Fields = new []
{
new QueryField { Name = "SearchString", FieldType = typeof(string)}
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
SecuritiesItem定义:
public class SecuritiesItem
{
/* all other fields */
public string ShortName { get; set; }
public string SearchString { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
SearchString包含需要在搜索中使用的所有字段的合并数据.像这样:
Открытоеакционерноеобщество"Рогаикопыта"#☢#Systems Open Joint-Stock Company#☢#ОАО"РиК"#☢#Ssys#☢#335468321#☢#bner#☢#ОАО"РиК"#☢#Systems Open Joint-股份公司#☢#Открытоеакционерноеобщество"Рогаикопыта"#☢#Systems Open Joint-Stock Company#☢#RU003572593#☢#1-22-22222-A
像这样搜索:
_securitiesCache
.AsCacheQueryable()
.Where(s => s.Value.SearchString.Contains(query))
// or .Where(s => s.Value.SearchString.ToLower().IndexOf(query) != -1)
.ToArray()
.Select(x => x.Value);
Run Code Online (Sandbox Code Playgroud)
所以,如果我搜索"开放" - 它会正常发现.但如果我搜索"Откр",则没有找到结果.
尝试使用'=='搜索对象中的特定字段,如ShortName,结果相同.我应该将文本转换为特定的编码吗?
SelfResolved
这是邮差.https://github.com/postmanlabs/postman-app-support/issues/2263 url编码中的错误.
| 归档时间: |
|
| 查看次数: |
85 次 |
| 最近记录: |