Apache Ignite.NET SQL 不搜索非英文字符 [英] Apache Ignite.NET SQL not searching for non english characters

查看:29
本文介绍了Apache Ignite.NET SQL 不搜索非英文字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 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)}
                      }
                  }
             }
         }
     }

证券项目定义:

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 Joint-Stock Company#☢#Открытое акционерноеобщество "Рога и копыта"#☢#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/2263 url 编码错误.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆