@@ -, +, @@ --- C4/Utils/DataTables/Members.pm | 6 +++--- misc/search_tools/reindex_patrons.pl | 24 +++++++++++++++++------- 2 files changed, 20 insertions(+), 10 deletions(-) --- a/C4/Utils/DataTables/Members.pm +++ a/C4/Utils/DataTables/Members.pm @@ -21,11 +21,11 @@ sub search { $searchmember = $dt_params->{sSearch} // ''; } - my ($sth, $query, $iTotalRecords, $iTotalDisplayRecords); + my ($sth, $query1, $iTotalRecords, $iTotalDisplayRecords); my $dbh = C4::Context->dbh; # Get the iTotalRecords DataTable variable - $query = "SELECT COUNT(borrowers.borrowernumber) FROM borrowers"; - $sth = $dbh->prepare($query); + $query1 = "SELECT COUNT(borrowers.borrowernumber) FROM borrowers"; + $sth = $dbh->prepare($query1); $sth->execute; ($iTotalRecords) = $sth->fetchrow_array; --- a/misc/search_tools/reindex_patrons.pl +++ a/misc/search_tools/reindex_patrons.pl @@ -12,11 +12,12 @@ $indexer->drop_index; my $patrons = Koha::Patrons->search; + my ( @id_buffer, @commit_buffer ); while ( my $patron = $patrons->next ) { my $id = $patron->borrowernumber; my $record = $patron->unblessed; - $record->{_id} = $id; + $record->{es_id} = $id; $record->{category_type} = $patron->category->category_type; push @id_buffer, $id; push @commit_buffer, $record; @@ -31,19 +32,28 @@ if ( !$indexer->store ) { data => { properties => { borrowernumber => { - type => 'string', + type => 'text', search_analyzer => 'analyser_standard', - index_analyzer => 'analyser_standard', + analyzer => 'analyser_standard', + fielddata => 'true' }, cardnumber => { - type => 'string', + type => 'text', search_analyzer => 'analyser_standard', - index_analyzer => 'analyser_standard', + analyzer => 'analyser_standard', + fielddata => 'true' }, surname => { - type => 'string', + type => 'text', + search_analyzer => 'analyser_standard', + analyzer => 'analyser_standard', + fielddata => 'true' + }, + firstname => { + type => 'text', search_analyzer => 'analyser_standard', - index_analyzer => 'analyser_standard', + analyzer => 'analyser_standard', + fielddata => 'true' }, } } --