Bugzilla – Attachment 61487 Details for
Bug 17500
Use Elasticsearch to search for patrons
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17500 - updates for ES 5.1
Bug-17500---updates-for-ES-51.patch (text/plain), 3.11 KB, created by
Nick Clemens (kidclamp)
on 2017-03-22 16:44:04 UTC
(
hide
)
Description:
Bug 17500 - updates for ES 5.1
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2017-03-22 16:44:04 UTC
Size:
3.11 KB
patch
obsolete
>From e3c3936ac2221e8a086e6bfe197d9a02998f8f29 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 22 Mar 2017 12:02:17 -0400 >Subject: [PATCH] Bug 17500 - updates for ES 5.1 > >--- > C4/Utils/DataTables/Members.pm | 6 +++--- > misc/search_tools/reindex_patrons.pl | 24 +++++++++++++++++------- > 2 files changed, 20 insertions(+), 10 deletions(-) > >diff --git a/C4/Utils/DataTables/Members.pm b/C4/Utils/DataTables/Members.pm >index 9998933..97bb30a 100644 >--- a/C4/Utils/DataTables/Members.pm >+++ b/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; > >diff --git a/misc/search_tools/reindex_patrons.pl b/misc/search_tools/reindex_patrons.pl >index 4d1b689..b6f0448 100644 >--- a/misc/search_tools/reindex_patrons.pl >+++ b/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' > }, > } > } >-- >2.1.4
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 17500
:
56867
|
56868
|
56869
|
56870
|
56871
|
56872
|
61481
|
61482
|
61483
|
61484
|
61485
|
61486
| 61487