Visibility information is now in Solr
This commit is contained in:
committed by
Gilles Crettenand
parent
de7864de4c
commit
c20cfabb67
@@ -22,8 +22,6 @@ class NetBiblio extends WebService
|
|||||||
*/
|
*/
|
||||||
private function CheckSession()
|
private function CheckSession()
|
||||||
{
|
{
|
||||||
$_SESSION["user"]["login"] = 35;
|
|
||||||
|
|
||||||
if (! isset ($_SESSION["user"]["login"])) {
|
if (! isset ($_SESSION["user"]["login"])) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -49,8 +47,7 @@ class NetBiblio extends WebService
|
|||||||
|
|
||||||
$this->checkSession();
|
$this->checkSession();
|
||||||
|
|
||||||
// $user = User::find($this->login);
|
$user = User::find($this->login);
|
||||||
$user = new User(array('login' => 35, 'id' => 511389));
|
|
||||||
|
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
throw new AuthenticationException("UserNotFound", "No user found for '{$this->login}'.", AuthenticationException::USER_NOT_FOUND);
|
throw new AuthenticationException("UserNotFound", "No user found for '{$this->login}'.", AuthenticationException::USER_NOT_FOUND);
|
||||||
@@ -508,6 +505,7 @@ class NetBiblio extends WebService
|
|||||||
|
|
||||||
$bs = new BookSearch();
|
$bs = new BookSearch();
|
||||||
$bs->addSortField('random_'.$seed);
|
$bs->addSortField('random_'.$seed);
|
||||||
|
$bs->addQuery(1, 'visible');
|
||||||
$results = $bs->getResults(0, $number);
|
$results = $bs->getResults(0, $number);
|
||||||
return $this->AddBookData($results['books']);
|
return $this->AddBookData($results['books']);
|
||||||
}
|
}
|
||||||
@@ -628,6 +626,9 @@ class NetBiblio extends WebService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// we only want visible books in search results
|
||||||
|
$bs->addQuery(1, 'visible');
|
||||||
|
|
||||||
$count = isset($queryArray['count']) ? (int) $queryArray['count'] : Configuration::get('solr.result_count');
|
$count = isset($queryArray['count']) ? (int) $queryArray['count'] : Configuration::get('solr.result_count');
|
||||||
$start = isset($queryArray['page']) ? $queryArray['page'] * $count : 0;
|
$start = isset($queryArray['page']) ? $queryArray['page'] * $count : 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user