...{ //获取分类 $arrTag = .........;//一维数组 $doc->setFields($data); $index->add($doc); foreach ($arrTag as $kt=>$vt) { $doc -> addTerm('cat', $vt); } dump($doc -> getAddTerms('b_tag_id')); } 是这样...
...s $node){ $cid = $node->getId(); if($i++ == 0){ $doc->setField('cid', $cid); }else{ $doc->addTerm('cid', $cid); } // 父类别id while($node = $node->getParent()){ $doc->addTerm('cid', $node->getId()); } } 搜索 $searc...