Apache Ignite.NET SQL not searching for non english characters

断了今生、忘了曾经 提交于 2019-12-23 19:50:04

问题


Using Apache Ignite .NET 2.3.0 Trying to search using Linq extension (Apache.Ignite.Linq).

Configuration:

     CacheConfiguration = new[]
     {
         new CacheConfiguration 
         {
             QueryEntities = new []
             {
                  new QueryEntity(typeof(string), typeof(SecuritiesItem))
                  {
                      Fields = new []
                      {
                          new QueryField { Name = "SearchString", FieldType = typeof(string)}
                      }
                  }
             }
         }
     }

SecuritiesItem definition:

public class SecuritiesItem
{
    /* all other fields */

    public string ShortName { get; set; }
    public string SearchString { get; set; }
}

SearchString contains merged data from all fields what need to be used in search. Like this:

Открытое акционерное общество " Рога и копыта "#☢#Systems Open Joint-Stock Company#☢#ОАО "РиК"#☢#Ssys#☢#335468321#☢#bner#☢#ОАО "РиК"#☢# Systems Open Joint-Stock Company#☢#Открытое акционерное общество "Рога и копыта"#☢#Systems Open Joint-Stock Company#☢#RU003572593#☢#1-22-22222-A

Searching like this:

_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.

Trying to search by specific field in object, like ShortName using '==', same result. Should I convert the text into a specific encoding?

SelfResolved

it's postman fault. https://github.com/postmanlabs/postman-app-support/issues/2263 bug in url encoding.


回答1:


Can you share a sample project-reproducer?

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.



来源:https://stackoverflow.com/questions/47697413/apache-ignite-net-sql-not-searching-for-non-english-characters

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!