Jump to content
thirty bees forum

Elasticsearch: managed to run module with the ES v.6.4 (almost)


DaoKakao

Recommended Posts

I've found three obstacles not allowing latest ES to work with TB ES module: 1. 'Coz i use php 7.2 i had to fix regex in the main module's file (elasticsearch.php): ``` protected static function splitUrl($url, $decode = true) { $xunressub = 'a-zA-Z\d-._~!$&\'()*+,;='; ...

    $xscheme = '([a-zA-Z][a-zA-Z\d+\-.]*)';

...
    $xhostName = '([a-zA-Z\d\-.%]+)';

```

In this lines some dashes should be cloaked with "\", except related to symbol ranges. Otherwise the module can't even connect to ES.

  1. I've found, that in database the product field's named "active" value set to '1' or '0'. Module's logic passes it to ES intact. Meanwhile, ES requires this field have to be true or false. I could not invent anything better than simple workaround in the module's file classes/Fetcher.php: ``` public static function initProduct($idProduct, $idLang) { ... $product = new Product($idProduct, true, $idLang);

    if ($product->active ==='1') {
        $product->active = true;
    } else {
        $product->active = false;
    }
    

    ... ``` After applying it everything worked (almost)

  2. Some of products weren't indexed however. Here's the ES's answer got during indexing: success true indexed 690 total 692 nbErrors 1 errors […] 0 {…} id_lang 1 id_shop 1 id_product 349 error Document contains at least one immense term in field="color_listproperty" (whose UTF8 encoding is longer than the max length 32766), all of which were skipped. Please correct the analyzer to not produce such terms. The prefix of the first immense term is: '[32, 32, 60, 117, 108, 32, 99, 108, 97, 115, 115, 61, 34, 99, 111, 108, 111, 114, 95, 116, 111, 95, 112, 105, 99, 107, 95, 108, 105, 115]...', original message: bytes can be at most 32766 in length; got 40860 bytes can be at most 32766 in length; got 40860

I suppose this is because that product has near 100 combinations, so need further investigations.

Regards.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...