Issues

ZF-92: Zend_Search_Lucene find() result set size restriction (reported by tobias382 gm l.c m in ald issue tracker)

Issue Type: New Feature Created: 2006-06-21T11:14:17.000+0000 Last Updated: 2007-07-05T14:44:28.000+0000 Status: Closed Fix version(s): - 0.1.4 (29/Jun/06)

Reporter: Alexander Veremyev (alexander) Assignee: Alexander Veremyev (alexander) Tags: - Zend_Search_Lucene

Related issues: Attachments:

Description

Below is a diff between a modified version of Zend/Search/Lucene.php and the original from 0.1.3. The differences add a feature to Zend_Search_Lucene::find() to allow an offset from the start of the result set and a maximum returned result set size to be specified without breaking backward compatibility. I've found that it substantially reduces processing time in cases where only a portion of the result set is desired.

218c218

< public function find($query, $offset = 0, $rowCount = 0)

public function find($query) 232d231 < $hitsCount = 0; 238, 241d236 < $hitsCount++; < if( $hitsCount <= $offset ) { < continue; < } 248, 250d242 < if ($rowCount == $hitsCount) { < break; < } 577c569

< }

}

Comments

Posted by Alexander Veremyev (alexander) on 2006-06-21T11:28:21.000+0000

find() needs to retrive full result set to order it by score.

From the other side each $hits entry is only <docID, score> pair. All other document attributes are retrieved from index "by request". Thus it's not necessary to limit result set.

With best regards, Alexander Veremyev.

Posted by Alexander Veremyev (alexander) on 2006-06-21T11:30:27.000+0000

This improvement will not increase performance actually, but only will complicate API.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts