The script that returns data for the patron autocomplete does not use C4::Members::Search. Instead it uses bespoke code that does not behave like the traditional search and is very limited in how it can search. If, for example, I search for "hall, k" in the standard search, I would get "Kyle Hall" back as a result. For the autocomplete search, I will not. This script should use C4::Members::Search to provide better searching and to keep the code base DRY.
Created attachment 36808 [details] [review] Bug 13822 - Patron autocomplete search is severly limited The script that returns data for the patron autocomplete does not use C4::Members::Search. Instead it uses bespoke code that does not behave like the traditional search and is very limited in how it can search. If, for example, I search for "Kyle Hall" in the standard search, I would get "Kyle Hall" back as a result. For the autocomplete search, I will not. This script should use C4::Members::Search to provide better searching and to keep the code base DRY. Test Plan: 1) Enable the system preference CircAutocompl 2) Create a user with the first name "Test" and the surname "User" 3) Perform a checkout autocomplete search for "Test User" 4) Note you do not get the user as a result 5) Apply this patch 6) Try different combinations of "Test" and "User" such as Test User User Test U Test Test U etc. 7) Note these searches now work
Tested for signing off, search behaviour is much better now! However, I propose to keep sorting, something like: my $order_by = 'surname, firstname'; my ($results) = Search( $term, $order_by, [ 10 ] );
Created attachment 37009 [details] [review] Bug 13822 - Patron autocomplete search is severly limited The script that returns data for the patron autocomplete does not use C4::Members::Search. Instead it uses bespoke code that does not behave like the traditional search and is very limited in how it can search. If, for example, I search for "Kyle Hall" in the standard search, I would get "Kyle Hall" back as a result. For the autocomplete search, I will not. This script should use C4::Members::Search to provide better searching and to keep the code base DRY. Test Plan: 1) Enable the system preference CircAutocompl 2) Create a user with the first name "Test" and the surname "User" 3) Perform a checkout autocomplete search for "Test User" 4) Note you do not get the user as a result 5) Apply this patch 6) Try different combinations of "Test" and "User" such as Test User User Test U Test Test U etc. 7) Note these searches now work
Done! (In reply to Marc Véron from comment #2) > Tested for signing off, search behaviour is much better now! > > However, I propose to keep sorting, something like: > > my $order_by = 'surname, firstname'; > my ($results) = Search( $term, $order_by, [ 10 ] );
Created attachment 37024 [details] [review] [Signed-off] Bug 13822 - Patron autocomplete search is severly limited The script that returns data for the patron autocomplete does not use C4::Members::Search. Instead it uses bespoke code that does not behave like the traditional search and is very limited in how it can search. If, for example, I search for "Kyle Hall" in the standard search, I would get "Kyle Hall" back as a result. For the autocomplete search, I will not. This script should use C4::Members::Search to provide better searching and to keep the code base DRY. Test Plan: 1) Enable the system preference CircAutocompl 2) Create a user with the first name "Test" and the surname "User" 3) Perform a checkout autocomplete search for "Test User" 4) Note you do not get the user as a result 5) Apply this patch 6) Try different combinations of "Test" and "User" such as Test User User Test U Test Test U etc. 7) Note these searches now work Folllowed test plan, works as expected Signed-off-by: Marc Véron <veron@veron.ch>
I am not sure about this change. With the patch applied a search for sch will bring up "Fischer" - so it does a 'contains' search. I think on a big system this will make the autocomplete harder to handle - it might bring up a lot of unrelated searches. There might be reasons to make the autocomplete more strict than the normal patron search, where you can pick your options.
I did a short test with following line: my ($results) = Search( $term, $order_by, [ 10 ],'','','start_with' ); This way, the search would be more restricted. To do a 'contains' search, the user can still use the wildcard character % 'Test' would give Testmann, Fritz Tester, Hans 'Hans' would give Meier, Hans Müller, Hansli '%est' would give Hatfield, Lester Testman, Fritz Tester, Hans West, Mae My proposition is to have the 'start_with' version and change the explanation from: Enter patron card number or partial name: to something like: Enter first digits/letters of patron card number or name. Prepend % for inline search.
Hm... the actual search matches the text, but the autocomplete is a different thing... I am not sure about this here. Would be good to test on a big database maybe. Maybe one of the bigger libraries could weigh in how they expect this to work?
Created attachment 37173 [details] [review] Bug 13822 [QA Followup] - Make search do a 'starts with' search
Created attachment 37177 [details] [review] [Signed-off] Bug 13822 [QA Followup] - Make search do a 'starts with' search Search uses now a 'starts with' search. Maxbe an other Sign-off is needed from a library with a huge number of patrons (see Katrins comment #8) Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 37328 [details] [review] Bug 13822 - Patron autocomplete search is severly limited The script that returns data for the patron autocomplete does not use C4::Members::Search. Instead it uses bespoke code that does not behave like the traditional search and is very limited in how it can search. If, for example, I search for "Kyle Hall" in the standard search, I would get "Kyle Hall" back as a result. For the autocomplete search, I will not. This script should use C4::Members::Search to provide better searching and to keep the code base DRY. Test Plan: 1) Enable the system preference CircAutocompl 2) Create a user with the first name "Test" and the surname "User" 3) Perform a checkout autocomplete search for "Test User" 4) Note you do not get the user as a result 5) Apply this patch 6) Try different combinations of "Test" and "User" such as Test User User Test U Test Test U etc. 7) Note these searches now work
Patch rewritten to take into account bug 13892. Completely new version will need a new sign off.
Created attachment 37331 [details] [review] Bug 13822 - Patron autocomplete search is severly limited The script that returns data for the patron autocomplete does not use C4::Members::Search. Instead it uses bespoke code that does not behave like the traditional search and is very limited in how it can search. If, for example, I search for "Kyle Hall" in the standard search, I would get "Kyle Hall" back as a result. For the autocomplete search, I will not. This script should use C4::Members::Search to provide better searching and to keep the code base DRY. Test Plan: 1) Enable the system preference CircAutocompl 2) Create a user with the first name "Test" and the surname "User" 3) Perform a checkout autocomplete search for "Test User" 4) Note you do not get the user as a result 5) Apply this patch 6) Try different combinations of "Test" and "User" such as Test User User Test U Test Test U etc. 7) Note these searches now work Works as expected. Signed-off-by: Marc Véron <veron@veron.ch>
This works ok, I am seeing a small issue with and without the patch - filed bug 13957 for it.
Created attachment 37522 [details] [review] [PASSED QA] Bug 13822 - Patron autocomplete search is severly limited The script that returns data for the patron autocomplete does not use C4::Members::Search. Instead it uses bespoke code that does not behave like the traditional search and is very limited in how it can search. If, for example, I search for "Kyle Hall" in the standard search, I would get "Kyle Hall" back as a result. For the autocomplete search, I will not. This script should use C4::Members::Search to provide better searching and to keep the code base DRY. Test Plan: 1) Enable the system preference CircAutocompl 2) Create a user with the first name "Test" and the surname "User" 3) Perform a checkout autocomplete search for "Test User" 4) Note you do not get the user as a result 5) Apply this patch 6) Try different combinations of "Test" and "User" such as Test User User Test U Test Test U etc. 7) Note these searches now work Works as expected. Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Patch pushed to master. Thanks Kyle! tatus: Pushed to Master
Is there any way to get this included in 3.18?