I
I
Ilya Beloborodov2016-02-20 12:58:33
Zend Framework
Ilya Beloborodov, 2016-02-20 12:58:33

Zend Search encoding. How to setup?

If you search in Cyrillic, then the
iconv_strlen() error appears: Detected an illegal character in input string
File /protected/vendor/Zend/Search/Lucene/Search/QueryLexer.php(342)
string

342:  $strLength = iconv_strlen($inputString, $encoding);

On the Internet, it was advised to prescribe this
Zend_Search_Lucene_Analysis_Analyzer::setDefault(
     new Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8_CaseInsensitive ()
 );

But still doesn't work. But in Latin everything is fine.
Maybe the server needs to be configured, I just deployed the server on the cloud yesterday, and maybe I missed something
Ubuntu 14
-----
I checked the encoding of the search query
echo mb_detect_encoding($term);- UTF-8

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Cat Anton, 2016-02-20
@kowap

Have you looked at what exactly is passed to $inputString and $encoding in line 342?
Are you using the latest version of Zend_Search_Lucene?

<?php

// Попробуйте добавить эту строку:
Zend_Search_Lucene_Search_QueryParser::setDefaultEncoding('utf-8');

Zend_Search_Lucene_Analysis_Analyzer::setDefault(
     new Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8_CaseInsensitive ()
);

If all this does not help, you need to look further, see how you carry out the search yourself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question