Skip to content

Issue with umlauts when using the keywords call #59

Description

@ForsakenNGS

Hi,

I'm having some trouble with the keywords regarding german umlauts. If I issue the call with:

$keywords = $index->keywords(implode("* ", $query)."*", []);

Which results in this request being sent to the http-interface:

    array (size=3)
      'url' => string 'http://127.0.0.1:9308/sql' (length=25)
      'headers' => 
        array (size=1)
          0 => string 'Content-Type: ' (length=14)
      'body' => string 'mode=raw&query=CALL KEYWORDS('k\xc3\xbcche*','ebiz_trader_ad_master_de')' (length=72)

And this result:

    array (size=5)
      'columns' => 
        array (size=3)
          0 => 
            array (size=1)
              'qpos' => 
                array (size=1)
                  'type' => string 'string' (length=6)
          1 => 
            array (size=1)
              'tokenized' => 
                array (size=1)
                  'type' => string 'string' (length=6)
          2 => 
            array (size=1)
              'normalized' => 
                array (size=1)
                  'type' => string 'string' (length=6)
      'data' => 
        array (size=1)
          0 => 
            array (size=3)
              'qpos' => string '1' (length=1)
              'tokenized' => string 'kxc3xbcche*' (length=11)
              'normalized' => string 'kxc3xbcche*' (length=11)
      'total' => int 0
      'error' => string '' (length=0)
      'warning' => string '' (length=0)

Currently I went to using a raw sql query like follwing to work around it, which works, but is far from ideal:

        $keywords = $this->manticoreClient()->sql([
            'mode' => 'raw',
            'body' => [
                "query" => "CALL KEYWORDS('".mysql_real_escape_string(implode("* ", $query)."*")."', '".mysql_real_escape_string($indexNameFull)."');"
            ]
        ]);

Metadata

Metadata

Assignees

No one assigned

    Labels

    waitingWaiting for more details from issue author

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions