1
我創建索引的功能是作爲波紋管Zend的Lucene的 - 如何做查詢
function create()
{
Zend_Search_Lucene_Analysis_Analyzer::setDefault(new Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8_CaseInsensitive());
$index = Zend_Search_Lucene::create('data/index');
$doc = new Zend_Search_Lucene_Document();
$doc->addField(Zend_Search_Lucene_Field::Text('title', 'a cheap car in town milage under 3000','utf-8'));
$doc->addField(Zend_Search_Lucene_Field::Text('detail','a cheap car in town milage under 3000','utf-8'));
$doc->addField(Zend_Search_Lucene_Field::Text('category', 'milage under 3000','utf-8'));
$index->addDocument($doc);
}
當「在3000下鎮milage一輛廉價汽車」用戶搜索,我將查詢拆分成3個部分
$query1 = "a cheap car";
$query2 = "in town";
$query3 = " milage under 3000";
我要搜索
$query1 in field "title", $query2 in field "detail", $query3 in field "category".
我也想搜索數量不區分大小寫和文本不區分大小寫。我該怎麼做?我需要實際的代碼,因爲我完全被Zend的Lucene的文檔迷茫,我不知道用哪個代碼或查詢。