From d04c98fc33af6e6d22cc2b82df9063b97f920d0a Mon Sep 17 00:00:00 2001 From: Gilles Crettenand Date: Fri, 29 May 2015 15:08:50 +0200 Subject: [PATCH] mobile app compatibility --- mobile.netbiblio.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mobile.netbiblio.php b/mobile.netbiblio.php index 2067bb9..376b5a1 100644 --- a/mobile.netbiblio.php +++ b/mobile.netbiblio.php @@ -329,9 +329,9 @@ class NetBiblio extends WebService if (isset($queryArray['queryText']) && strlen($queryArray['queryText']) > 0) { $type = isset($queryArray['queryType']) ? $queryArray['queryType'] : null; - // this is done for compatibility reason with the older iOS and Android apps - if($type == 'producer') { - $type = 'producerCode'; + if($this->client != 'website' && in_array($type, array('title', 'author', 'reader'))) { + // we don't want an exact search on mobile apps + $type = $type.'_fr'; } $bs->addQuery($queryArray['queryText'], $type); @@ -353,6 +353,11 @@ class NetBiblio extends WebService $bs->addQuery(1, 'jeunesse'); } + // The following query filter is used by the mobile applications + if(isset($queryArray['producer']) && strlen($queryArray['producer']) > 0) { + $bs->addQuery($queryArray['producer'], 'producerCode'); + } + $count = isset($queryArray['count']) ? (int) $queryArray['count'] : Configuration::get('solr.result_count'); $start = isset($queryArray['page']) ? $queryArray['page'] * $count : 0;