Search code examples
c#.net-coreignite

Apache Ignite.NET SQL not searching for non english characters


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.


Solution

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