Bugzilla – Attachment 65860 Details for
Bug 18514
Allow library to search their Koha and Overdrive collections using ElasticSearch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18514 : Adding search capabilities for Overdrive results in Koha
Bug-18514--Adding-search-capabilities-for-Overdriv.patch (text/plain), 1.97 KB, created by
Chris Cormack
on 2017-08-10 20:47:46 UTC
(
hide
)
Description:
Bug 18514 : Adding search capabilities for Overdrive results in Koha
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2017-08-10 20:47:46 UTC
Size:
1.97 KB
patch
obsolete
>From 94d23aa6fbed50ebf3ccb8c4a84e40d34a57f3eb Mon Sep 17 00:00:00 2001 >From: Chris Cormack <chrisc@catalyst.net.nz> >Date: Tue, 20 Sep 2016 19:55:04 +0000 >Subject: [PATCH] Bug 18514 : Adding search capabilities for Overdrive results > in Koha > >To test >1/ Apply the first patch and run the script in it >2/ Search, notice no Overdrive results showing >3/ Search again, now you should get results in the OPAC results page >--- > Koha/SearchEngine/Elasticsearch/Search.pm | 18 ++++++++++++++++-- > 1 file changed, 16 insertions(+), 2 deletions(-) > >diff --git a/Koha/SearchEngine/Elasticsearch/Search.pm b/Koha/SearchEngine/Elasticsearch/Search.pm >index cec1cb7fb6..9f7698c58c 100644 >--- a/Koha/SearchEngine/Elasticsearch/Search.pm >+++ b/Koha/SearchEngine/Elasticsearch/Search.pm >@@ -158,9 +158,23 @@ sub search_compat { > $index = $offset; # opac-search expects results to be put in the > # right place in the array, according to $offset > $results->each(sub { >+ my $marc; > # The results come in an array for some reason >- my $marc_json = $_[0]->{record}; >- my $marc = $self->json2marc($marc_json); >+ unless (ref($_[0]->{'Local-number'}) ){ >+# shift this to overdrive stuff >+ $marc = MARC::Record->new(); >+ $marc->add_fields( >+ [ 245, "1", " ", a => $_[0]->{title}, b=> $_[0]->{subtitle} ], >+ [ 100, "", "", a => $_[0]->{'primaryCreator'}->{'name'}], >+ [ 999, "", "", c => $_[0]->{'Local-number'}], >+ [ 999, "", "", d => $_[0]->{'Local-number'}], >+ [ 999, "", "", a => 'ExtOverdrive' ], >+ ); >+ } >+ else { >+ my $marc_json = $_[0]->{record}; >+ $marc = $self->json2marc($marc_json); >+ } > $records[$index++] = $marc; > }); > # consumers of this expect a name-spaced result, we provide the default >-- >2.13.3
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18514
:
62902
|
62903
|
62904
|
65004
|
65858
|
65859
| 65860 |
65861