From 8614f3489b728aa3efcc0d4770f32a488c26a02d Mon Sep 17 00:00:00 2001 From: Gilles Crettenand Date: Tue, 16 Jun 2015 11:29:48 +0200 Subject: [PATCH] - catch all Solr exception, not only the client ones - add field list just in case --- Lib/Search/BookSearch.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Lib/Search/BookSearch.php b/Lib/Search/BookSearch.php index e327543..44addec 100644 --- a/Lib/Search/BookSearch.php +++ b/Lib/Search/BookSearch.php @@ -35,6 +35,14 @@ class BookSearch // most options like search fields, sorting, etc are already set // as default in the Solr config and thus should be set only on a // per request basis when needed + + /* if sometime we need to set the fields explicitly, those should be the ones we want : + $this->query->addField('id, code, isbn'); + $this->query->addField('editor, editorTown, year, producer, producerCode, availabilityDate, collection'); + $this->query->addField('title, author, reader, summary'); + $this->query->addField('jeunesse, genre, genreCode, motsMatieres, cdu'); + $this->query->addField('media, mediaType, cover, samples, zip, zip_size'); + */ } public function addOrQuery(array $texts, $field) @@ -104,7 +112,7 @@ class BookSearch try { $results = $this->client->query($this->query)->getArrayResponse(); - } catch(\SolrClientException $e) { + } catch(\SolrException $e) { throw new WebException ("SolrError", $e->getMessage(), -700); }