pdphilip / laravel-elasticsearch

Laravel Elasticsearch: An Elasticsearch implementation of Laravel's Eloquent ORM
https://elasticsearch.pdphilip.com/
MIT License
95 stars 17 forks source link

[Fixed] Non latin words #4

Closed Deviance-Dev closed 1 year ago

Deviance-Dev commented 1 year ago

Everything works fine, except for searching in Cyrillic, there is no output.

Although in Kibana everything works fine

pdphilip commented 1 year ago

Happy to have a look, but need more info:

Then please provide:

Deviance-Dev commented 1 year ago

Thank you for quick response! U doing great work

Plugin Version: 1.8x Laravel 8x ES 7.5.2

Code is working fine with english words, but not working with cyrillic.

$data = Post::where('text', 'like', $search)
                ->orderBy('date.keyword')
                ->paginate(15)
                ->appends(['search' => $search]);

Kibana request working great

{
  "version": true,
  "size": 500,
  "sort": [
    {
      "_score": {
        "order": "desc"
      }
    }
  ],
  "_source": {
    "excludes": []
  },
  "stored_fields": [
    "*"
  ],
  "script_fields": {},
  "docvalue_fields": [],
  "query": {
    "bool": {
      "must": [],
      "filter": [
        {
          "multi_match": {
            "type": "best_fields",
            "query": "президент",
            "lenient": true
          }
        }
      ],
      "should": [],
      "must_not": []
    }
  },
  "highlight": {
    "pre_tags": [
      "@kibana-highlighted-field@"
    ],
    "post_tags": [
      "@/kibana-highlighted-field@"
    ],
    "fields": {
      "*": {}
    },
    "fragment_size": 2147483647
  }
}
pdphilip commented 1 year ago

Hey @Deviance-Dev

I think I was able to zero in on the issue here. Please update your plugin to 1.8.1 and try again: https://github.com/pdphilip/laravel-elasticsearch/releases/tag/v1.8.1

Let me know if that has fixed the issue so that I can port this updated to the other versions. Thanks!

Deviance-Dev commented 1 year ago

Oh, @pdphilip it's working now. Thank you very much for such great job :)