- catch all Solr exception, not only the client ones
- add field list just in case
This commit is contained in:
@@ -35,6 +35,14 @@ class BookSearch
|
|||||||
// most options like search fields, sorting, etc are already set
|
// most options like search fields, sorting, etc are already set
|
||||||
// as default in the Solr config and thus should be set only on a
|
// as default in the Solr config and thus should be set only on a
|
||||||
// per request basis when needed
|
// 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)
|
public function addOrQuery(array $texts, $field)
|
||||||
@@ -104,7 +112,7 @@ class BookSearch
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$results = $this->client->query($this->query)->getArrayResponse();
|
$results = $this->client->query($this->query)->getArrayResponse();
|
||||||
} catch(\SolrClientException $e) {
|
} catch(\SolrException $e) {
|
||||||
throw new WebException ("SolrError", $e->getMessage(), -700);
|
throw new WebException ("SolrError", $e->getMessage(), -700);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user