0

I am using Zend_Search_lucene 1.12 with codeignter for searching English & Arabic data, English works well but I get wrong results with Arabic. this is my code

Zend_Search_Lucene_Analysis_Analyzer::setDefault(
new Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8Num_CaseInsensitive ()); 
$index = Zend_Search_Lucene::create($this->_INDEX_PATH_CONST); 
$document->addField(Zend_Search_Lucene_Field::Text('video_ar_title', strtolower($record['video_ar_title'])), 'utf-8');

$index->addDocument($document);
$index->optimize();
$index->commit(); 

for search Zend_Search_Lucene_Analysis_Analyzer::setDefault( new Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8Num_CaseInsensitive ()); $index = Zend_Search_Lucene::open($this->_INDEX_PATH_CONST); Zend_Search_Lucene_Search_QueryParser::setDefaultEncoding('utf-8');

$termsStr = 'البحث';
$term  = new Zend_Search_Lucene_Index_Term($termsStr); 
$queryTerm = new Zend_Search_Lucene_Search_Query_Term($term);
$hits = $index->find(strtolower($queryTerm));   

besides that Arabic character is encodded with wrong encoding ! what is my my problem, I have tried everything, but nothing works for me, Please HELP!!

1 Answers1

0

I solve the problem by changing the regular expression in analyzer