unknwon: some code laying around
This commit is contained in:
@@ -304,6 +304,19 @@ class BookSearch
|
||||
return $books;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* it is faster to do multiple small request to Solr rather than one big so
|
||||
* check self::getBooks(array $codes, $field = 'code') for a chunked request
|
||||
* in chunks if we are above the limit. 15 was found by testing and seems to be a sweet spot
|
||||
*/
|
||||
public static function getBooksFull(array $codes, $field = 'code') {
|
||||
$bs = self::getLastInstance();
|
||||
$bs->addOrQuery($codes, $field);
|
||||
$results = $bs->getResults(0, count($codes));
|
||||
return $results['books'];
|
||||
}
|
||||
|
||||
public static function getTerms($field) {
|
||||
$s = self::getLastInstance();
|
||||
$s->addFilterQuery(1, 'visible');
|
||||
|
||||
Reference in New Issue
Block a user