View | Details | Raw Unified | Return to bug 14567
Collapse All | Expand All

(-)a/Koha/SearchEngine/Elasticsearch/Browse.pm (-1 / +1 lines)
Lines 179-185 __END__ Link Here
179
179
180
=over 4
180
=over 4
181
181
182
=item Robin Sheat C<< <robin@catalyst.net.nz> >>
182
=item Robin Sheat << <robin@catalyst.net.nz> >>
183
183
184
=back
184
=back
185
185
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-browse.tt (-4 / +6 lines)
Lines 1-6 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE Asset %]
3
[% USE raw %]
2
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
3
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Browse our catalog</title>
5
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo; Browse our catalog</title>
4
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
5
[% BLOCK cssinclude %][% END %]
7
[% BLOCK cssinclude %][% END %]
6
[% INCLUDE 'bodytag.inc' bodyid='opac-browser' %]
8
[% INCLUDE 'bodytag.inc' bodyid='opac-browser' %]
Lines 60-66 Link Here
60
62
61
                    <div id="browse-resultswrapper" class="hidden">
63
                    <div id="browse-resultswrapper" class="hidden">
62
                        <ul id="browse-searchresults" class="span3" start="-1" aria-live="polite">
64
                        <ul id="browse-searchresults" class="span3" start="-1" aria-live="polite">
63
                            <li class="loading hidden"><img src="[% interface %]/[% theme %]/images/loading.gif" alt=""> Loading</li>
65
                            <li class="loading hidden"><img src="[% interface | html %]/[% theme |html %]/images/loading.gif" alt=""> Loading</li>
64
66
65
                            <li class="no-results hidden">Sorry, there are no results, try a different search term.</li>
67
                            <li class="no-results hidden">Sorry, there are no results, try a different search term.</li>
66
                        </ul>
68
                        </ul>
Lines 69-75 Link Here
69
71
70
                        <div id="browse-selectionsearch" class="span9 hidden">
72
                        <div id="browse-selectionsearch" class="span9 hidden">
71
                            <div class="loading hidden">
73
                            <div class="loading hidden">
72
                                <img src="[% interface %]/[% theme %]/images/loading.gif" alt=""> Loading
74
                                <img src="[% interface | html %]/[% theme | html %]/images/loading.gif" alt=""> Loading
73
                            </div>
75
                            </div>
74
76
75
                            <div class="no-results hidden">No results</div>
77
                            <div class="no-results hidden">No results</div>
Lines 84-89 Link Here
84
</div><!-- / .main -->
86
</div><!-- / .main -->
85
[% INCLUDE 'opac-bottom.inc' %]
87
[% INCLUDE 'opac-bottom.inc' %]
86
[% BLOCK jsinclude %]
88
[% BLOCK jsinclude %]
87
<script type="text/javascript" src="[% interface %]/[% theme %]/js/browse.js">
89
[% Asset.js("/js/browse.js") | $raw %]
88
</script>
90
</script>
89
[% END %]
91
[% END %]
(-)a/opac/opac-browse.pl (-7 / +5 lines)
Lines 84-107 elsif ( $api eq 'GetResults' ) { Link Here
84
84
85
    my $query = { query => { term => { $field.".raw" => $term } } } ;
85
    my $query = { query => { term => { $field.".raw" => $term } } } ;
86
    my $results = $searcher->search( $query, undef, 500 );
86
    my $results = $searcher->search( $query, undef, 500 );
87
    my @output = _filter_for_output( $results->{hits} );
87
    my @output = _filter_for_output( $results->{hits}->{hits} );
88
    print header(
88
    print CGI::header(
89
        -type    => 'application/json',
89
        -type    => 'application/json',
90
        -charset => 'utf-8'
90
        -charset => 'utf-8'
91
    );
91
    );
92
    print to_json( \@output );
92
    print to_json( \@output );
93
}
93
}
94
94
95
# This is a temporary, MARC21-only thing that will grab titles, and authors
96
# This should probably be done with some templatey gizmo
95
# This should probably be done with some templatey gizmo
97
# in the future.
96
# in the future.
98
sub _filter_for_output {
97
sub _filter_for_output {
99
    my ($records) = @_;
98
    my ($records) = @_;
100
    my @output;
99
    my @output;
101
    foreach my $rec (@$records) {
100
    foreach my $rec (@$records) {
102
        my $biblionumber = $rec->{es_id};
101
        my $biblionumber = $rec->{_id};
103
        my $biblio = Koha::Biblios->find({ biblionumber=>$biblionumber });
102
        my $biblio = Koha::Biblios->find( $biblionumber );
104
warn $biblio->title;
103
        next unless $biblio;
105
        push @output,
104
        push @output,
106
          {
105
          {
107
            id => $biblionumber,
106
            id => $biblionumber,
108
- 

Return to bug 14567