BZ 19582 make auth_finder.pl use search_auth_compat instead of SearchAuthorities. It remains to do the same to the autocomplete feature provided for each search fields. See comment: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19582#c8
Created attachment 72090 [details] [review] Bug 20273 - Use compat routines for autocomplete in auth_finder.pl Test plan: - Context: Koha working with elasticsearch, - Apply BZ 19582 (that make auth_finder.pl works again), - apply this patch, - go to cgi-bin/koha/authorities/auth_finder.pl, - type at least 3 chararcters in a search field and check that the autocomplete returns results
Didn't work.
I applied again with apply-on-cascade bz, applied all patches, update db, koha schema, reset mappings, rebuild index... for what it's worth, here is the ysearch url : http://localhost:9999/cgi-bin/koha/authorities/ysearch.pl?authtypecode=&term=Sha&op=do_search&type=intranet&and_or=and&operator=contains&orderby=HeadingAsc&querytype=mainmainentry I have '[]' as a result. Note I can't use normal search and find something with 'sha' or 'sha*', I have results with the complete 'shalev'. When I type 'shalev' in place of 'sha' in ysearch, it answers an error: Software error: Undefined subroutine &C4::AuthoritiesMarc::BuildSummary called at /home/koha/kohaclone/Koha/SearchEngine/Elasticsearch/Search.pm line 234.
Created attachment 73307 [details] [review] Bug 20273 - Use compat routines for autocomplete in auth_finder.pl Test plan: - Context: Koha working with elasticsearch, - Apply BZ 19582 (that make auth_finder.pl works again), - apply this patch, - go to cgi-bin/koha/authorities/auth_finder.pl, - type at least 3 chararcters in a search field and check that the autocomplete returns results
The ysearch.pl use 'contains' operator instead of 'start'. When adjusting the search form to 'start with', ysearch.pl still launch a 'contains' operator. It means we need to put a complete word to make it work. Is it the wanted behaviour? Wouldn't it be better to put a start operator by default? When I type three letters and see the wheel spinning without results, it feels like nothing looks like what I typed.
(In reply to Nicolas Legrand from comment #5) > The ysearch.pl use 'contains' operator instead of 'start'. When adjusting > the search form to 'start with', ysearch.pl still launch a 'contains' > operator. It means we need to put a complete word to make it work. > > Is it the wanted behaviour? Wouldn't it be better to put a start operator by > default? When I type three letters and see the wheel spinning without > results, it feels like nothing looks like what I typed. I'm not sure of the right answer, but i'm not upset by that. Operators are used for the search itself, not for autocomplete.
Created attachment 74996 [details] [review] Bug 20273 - Use compat routines for autocomplete in auth_finder.pl Test plan: - Context: Koha working with elasticsearch, - Apply BZ 19582 (that make auth_finder.pl works again), - apply this patch, - go to cgi-bin/koha/authorities/auth_finder.pl, - type at least 3 chararcters in a search field and check that the autocomplete returns results
Created attachment 74997 [details] [review] Bug 20273: Followup - Autocomplete use start instead of contains
Created attachment 74998 [details] [review] Bug 20273 - Use compat routines for autocomplete in auth_finder.pl Test plan: - Context: Koha working with elasticsearch, - Apply BZ 19582 (that make auth_finder.pl works again), - apply this patch, - go to cgi-bin/koha/authorities/auth_finder.pl, - type at least 3 chararcters in a search field and check that the autocomplete returns results Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Created attachment 74999 [details] [review] Bug 20273: Followup - Autocomplete use start instead of contains Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Created attachment 75000 [details] [review] Bug 20273 - Use compat routines for autocomplete in auth_finder.pl Test plan: - Context: Koha working with elasticsearch, - Apply BZ 19582 (that make auth_finder.pl works again), - apply this patch, - go to cgi-bin/koha/authorities/auth_finder.pl, - type at least 3 chararcters in a search field and check that the autocomplete returns results Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Created attachment 75001 [details] [review] Bug 20273: Followup - Autocomplete use start instead of contains Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
I'd love to test this, but I am stuck on my Elasticsearch authority search not working at all. This is what I've tried: I've reset my mappings using: http://localhost:8081/cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl?op=reset&i_know_what_i_am_doing=1 Then I've done a complete reindex. When I search for an authority, I get an Internal server error resolving to: [Request] ** [http://localhost:9200]-[400] [query_shard_exception] No mapping found for [Heading__sort.phrase] in order to sort on, with: {"index":"koha_kohadev_authorities","index_uuid":"FwdgBXbyRq-5E0F3sa4LTA"}, called from sub Search::Elasticsearch::Role::Client::Direct::__ANON__ at /usr/share/perl5/Catmandu/Store/ElasticSearch/Bag.pm line 167. With vars: {'request' => {'method' => 'GET','path' => '/koha_kohadev_authorities/data/_search','ignore' => [],'mime_type' => 'application/json','qs' => {},'body' => {'sort' => [{'Heading__sort.phrase' => 'asc'}],'query' => {'bool' => {'should' => [{'match' => {'Heading-Main' => 'k'}}]}},'size' => 20,'from' => 0},'serialize' => 'std'},'status_code' => 400,'body' => {'status' => 400,'error' => {'type' => 'search_phase_execution_exception','grouped' => bless( do{\(my $o = 1)}, 'JSON::PP::Boolean' ),'failed_shards' => [{'shard' => 0,'reason' => {'index' => 'koha_kohadev_authorities','type' => 'query_shard_exception','reason' => 'No mapping found for [Heading__sort.phrase] in order to sort on','index_uuid' => 'FwdgBXbyRq-5E0F3sa4LTA'},'node' => 'vSTPqetISteesIkQSA_Ehg','index' => 'koha_kohadev_authorities'}],'phase' => 'query','reason' => 'all shards failed','root_cause' => [{'type' => 'query_shard_exception','index' => 'koha_kohadev_authorities','reason' => 'No mapping found for [Heading__sort.phrase] in order to sort on','index_uuid' => 'FwdgBXbyRq-5E0F3sa4LTA'}]}}} Unable to perform your search. Please try again. Anyone able to help or point me in the right direction?
Have you tried sort 'None' ?
I was doing a 'standard' search in authorities search, without changing any settings. What do you mean by none?
Ther(In reply to Katrin Fischer from comment #15) > I was doing a 'standard' search in authorities search, without changing any > settings. What do you mean by none? there is a sort menu after the input field which can be set to 'Heading A-Z', 'Heading Z-A' or 'None'. I remember Nick once told me it wasn't working well. Plus there is some 'sort' trouble in your log so I thought about this, but maybe it is not relevant.
Hi Nicolas, thx! 'None' works. Is there a bug already about the broken sorting for authorities with Elasticsearch?
(In reply to Katrin Fischer from comment #17) > Hi Nicolas, thx! 'None' works. Great! > Is there a bug already about the broken sorting for authorities with > Elasticsearch? I think it's Bug 19604. I cc Nick so he can confirm.
(In reply to Nicolas Legrand from comment #18) > (In reply to Katrin Fischer from comment #17) > > Hi Nicolas, thx! 'None' works. > > Great! > > > Is there a bug already about the broken sorting for authorities with > > Elasticsearch? > > I think it's Bug 19604. I cc Nick so he can confirm. I believe that is correct, 19604 will at least improve the sorting situation
I feel this is not an enh as the autocomplate displays, but doesn't work without this patch. Changing to 'normal'.
Sorry, but I can' test this - I switched the sort to none, but the auto-complete feature triggers the same error for the sorting. I think we need to fix this first. [Request] ** [http://localhost:9200]-[400] [query_shard_exception] No mapping found for [Heading__sort.phrase] in order to sort on, with: {"index_uuid":"FwdgBXbyRq-5E0F3sa4LTA","index":"koha_kohadev_authorities"}, called from sub Search::Elasticsearch::Role::Client::Direct::__ANON__ at /usr/share/perl5/Catmandu/Store/ElasticSearch/Bag.pm line 167. With vars: {'body' => {'status' => 400,'error' => {'failed_shards' => [{'index' => 'koha_kohadev_authorities','node' => 'vSTPqetISteesIkQSA_Ehg','reason' => {'index' => 'koha_kohadev_authorities','index_uuid' => 'FwdgBXbyRq-5E0F3sa4LTA','reason' => 'No mapping found for [Heading__sort.phrase] in order to sort on','type' => 'query_shard_exception'},'shard' => 0}],'type' => 'search_phase_execution_exception','root_cause' => [{'type' => 'query_shard_exception','reason' => 'No mapping found for [Heading__sort.phrase] in order to sort on','index_uuid' => 'FwdgBXbyRq-5E0F3sa4LTA','index' => 'koha_kohadev_authorities'}],'reason' => 'all shards failed','phase' => 'query','grouped' => bless( do{\(my $o = 1)}, 'JSON::PP::Boolean' )}},'request' => {'path' => '/koha_kohadev_authorities/data/_search','qs' => {},'ignore' => [],'mime_type' => 'application/json','serialize' => 'std','body' => {'sort' => [{'Heading__sort.phrase' => 'asc'}],'size' => 50,'from' => 0,'query' => {'bool' => {'should' => [{'wildcard' => {'Heading-Main.phrase' => 'sew*'}}]}}},'method' => 'GET'},'status_code' => 400} Unable to perform your search. Please try again.
It seems it can't work right now without fixing authority sorting. We could also mark it BLOCKED instead if that is preferred. Hopefully it can be resolved soon!
Created attachment 77090 [details] [review] Bug 20273: Use compat routines for autocomplete in auth_finder.pl Test plan: - Context: Koha working with elasticsearch, - Apply BZ 19582 (that make auth_finder.pl works again), - apply this patch, - go to cgi-bin/koha/authorities/auth_finder.pl, - type at least 3 chararcters in a search field and check that the autocomplete returns results Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Created attachment 77091 [details] [review] Bug 20273: (follow-up) Autocomplete use start instead of contains Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Awesome work all! Pushed to master for 18.11
Depends on bug 19604 which needs clarifications and help in backporting to 18.05.x branch.. awaiting feedback there.
Pushed to 18.05.x for 18.05.03.
Depends on bugs not in 17.11.x