A
A
Alexey Shvorak2014-02-03 08:49:39
PHP
Alexey Shvorak, 2014-02-03 08:49:39

Why does Sphinx encoding break?

Hello.
There is an encoding issue when passing parameters to Sphinx.

index posts
{
        source = posts
        path = /var/data/site/posts
        docinfo = extern
        mlock = 0
        morphology = stem_ru, stem_en, soundex
        min_word_len = 2
        min_infix_len = 2
        charset_type = utf-8
        #charset_table = 0..9, A..Z->a..z, _, a..z, U+A8->U+B8, U+B8, U+C0..U+DF->U+E0..U+FF, U+E0..U+FF
        #charset_table = 0..9, A..Z->a..z, _, a..z, U+C4->U+E4, U+D6->U+F6, U+DC->U+FC, U+DF,U+E4, U+F6, U+FC
        html_strip = 1
        enable_star = 1
}

When I send Cyrillic text there, I get the following response
array(9) {
  ["error"]=>
  string(0) ""
  ["warning"]=>
  string(0) ""
  ["status"]=>
  int(0)
  ["fields"]=>
  array(6) {
    [0]=>
    string(5) "title"
    [1]=>
    string(4) "text"
    [2]=>
    string(4) "name"
    [3]=>
    string(8) "username"
    [4]=>
    string(10) "first_name"
    [5]=>
    string(9) "last_name"
  }
  ["attrs"]=>
  array(1) {
    ["status"]=>
    int(1)
  }
  ["total"]=>
  string(1) "0"
  ["total_found"]=>
  string(1) "0"
  ["time"]=>
  string(5) "0.000"
  ["words"]=>
  array(2) {
    ["???"]=>
    array(2) {
      ["docs"]=>
      string(1) "0"
      ["hits"]=>
      string(1) "0"
    }
    ["*???*"]=>
    array(2) {
      ["docs"]=>
      string(1) "0"
      ["hits"]=>
      string(1) "0"
    }
  }
}

Base in utf8, connection too.
I use PhalconPHP and I have suhosin on the server (maybe it's a problem? I saw it somewhere)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question