Пример #1
0
 public function testTermPositions()
 {
     $directory = new Zend_Search_Lucene_Storage_Directory_Filesystem(dirname(__FILE__) . '/_source/_files');
     $segmentInfo = new Zend_Search_Lucene_Index_SegmentInfo($directory, '_1', 2);
     $termPositions = $segmentInfo->termPositions(new Zend_Search_Lucene_Index_Term('bgcolor', 'contents'));
     $this->assertTrue($termPositions == array(0 => array(69, 239, 370), 1 => array(58)));
     $termPositions = $segmentInfo->termPositions(new Zend_Search_Lucene_Index_Term('bgcolor', 'contents'), 10);
     $this->assertTrue($termPositions == array(10 => array(69, 239, 370), 11 => array(58)));
 }