Apache Ignite.NET SQL不搜索非英文字符 [英] Apache Ignite.NET SQL not searching for non english characters
问题描述
使用Apache Ignite .NET 2.3.0 尝试使用Linq扩展名(Apache.Ignite.Linq)进行搜索.
Using Apache Ignite .NET 2.3.0 Trying to search using Linq extension (Apache.Ignite.Linq).
配置:
CacheConfiguration = new[]
{
new CacheConfiguration
{
QueryEntities = new []
{
new QueryEntity(typeof(string), typeof(SecuritiesItem))
{
Fields = new []
{
new QueryField { Name = "SearchString", FieldType = typeof(string)}
}
}
}
}
}
SecuritiesItem定义:
SecuritiesItem definition:
public class SecuritiesItem
{
/* all other fields */
public string ShortName { get; set; }
public string SearchString { get; set; }
}
SearchString包含来自所有字段的合并数据,这些数据需要在搜索中使用.像这样:
SearchString contains merged data from all fields what need to be used in search. Like this:
ОткрытоеакционерноеобществоРогаикопыта #☢#Systems开放股份公司#☢#ОАО РиК"#☢#Ssys#☢#335468321#☢#bner#☢#ОАОРиК"#☢# Systems Open股份公司#☢#Открытоеакционерное обществоРогаикопыта"#☢#Systems 公开股份公司#☢#RU003572593#☢#1-22-22222-A
Открытое акционерное общество " Рога и копыта "#☢#Systems Open Joint-Stock Company#☢#ОАО "РиК"#☢#Ssys#☢#335468321#☢#bner#☢#ОАО "РиК"#☢# Systems Open Joint-Stock Company#☢#Открытое акционерное общество "Рога и копыта"#☢#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);
因此,如果我搜索打开"-它会正常运行.但是,如果我搜索Откр",则找不到结果.
So, if i searching for "Open" - it find everithing normally. But if i searching for "Откр", no results found.
尝试按对象中的特定字段进行搜索,例如使用'=='的ShortName,结果相同.我应该将文本转换为特定的编码吗?
Trying to search by specific field in object, like ShortName using '==', same result. Should I convert the text into a specific encoding?
已解决
这是邮递员的过错. https://github.com/postmanlabs/postman-app-support/issues/URL编码中出现2263 错误.
it's postman fault. https://github.com/postmanlabs/postman-app-support/issues/2263 bug in url encoding.
推荐答案
您可以共享一个示例项目复制者吗?
Can you share a sample project-reproducer?
我更新了几个测试,它们在类似情况下也能正常工作.我没有更改编码或将文本转换为某些特定的编码,默认情况下为UTF-8.
I updated several tests and they work fine for a similar case. I did not change encoding or convert text into some specific encoding, it is in UTF-8 by default.
这篇关于Apache Ignite.NET SQL不搜索非英文字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!