Hi, A search made on Shelving location tab in advanced search gives 0 result. Test plan : - in advanced search, choose a location in shelving location tab and start search (opac-search.pl?idx=kw&op=and&idx=kw&op=and&idx=kw&do=Search&limit=mc-loc) - 0 result - check that location exist by doing a simple search and filtering on the location facet - have some results I think problem is index "loc" is used in advanced search or it could be index "location" like facet. Or is it a configuration problem? Regards Marjorie
Created attachment 89378 [details] [review] Bug 22426: Elasticsearch - Index location is missing in advanced search
Any test plan?
Test plan : Without patch: - in advanced search, choose a location in shelving location tab and start search (opac-search.pl?idx=kw&op=and&idx=kw&op=and&idx=kw&do=Search&limit=mc-loc) - 0 result - check that location exist by doing a simple search and filtering on the location facet - have some results With patch: - in advanced search, choose a location in shelving location tab and start search (opac-search.pl?idx=kw&op=and&idx=kw&op=and&idx=kw&do=Search&limit=mc-loc) - found results Thanks.
Sorry, but link from test plan gives me: No results found! You did not specify any search criteria. Error: Unable to perform your search. Please try again. I tried reindex ES, but same result. Link from working search looks like: cgi-bin/koha/opac-search.pl?advsearch=1&idx=kw&q=a&idx=kw&idx=kw&limit=branch%3ACPL&limit=available&sort_by=relevance&do=Search
(In reply to Michal Denar from comment #4) > Sorry, but link from test plan gives me: > > No results found! > > You did not specify any search criteria. > Error: > Unable to perform your search. Please try again. > > I tried reindex ES, but same result. > > Link from working search looks like: > cgi-bin/koha/opac-search. > pl?advsearch=1&idx=kw&q=a&idx=kw&idx=kw&limit=branch%3ACPL&limit=available&so > rt_by=relevance&do=Search Hi Michal, In your url I see the limitation by branch (limit=branch%3ACPL) but not on a location (mc-loc) The patch is to solve the problem of searching on the index location. You should have a result of type opac-search.pl?idx=kw&op=and&idx=kw&op=and&idx=kw&do=Search&limit=mc-loc Regards, Marjorie
I see that there is a removal of "mc-" before index to field convertion : Added by commit : Bug 12478: fix multi-choice stuff in advanced search In Koha/SearchEngine/Elasticsearch/QueryBuilder.pm : my $mc = ''; if ($f =~ /^mc-/) { $mc = 'mc-'; $f =~ s/^mc-//; } And in %index_field_convert there is : 'mc-loc' => 'location' So I think adding loc => location should fix the problem. That is why there is no problem with mc-ccode and mc-itemtype.
Created attachment 90670 [details] [review] Bug 22426: (alternate) Elasticsearch fix location limit in advanced search A search made on Shelving location tab in advanced search gives 0 result. Test plan : Without patch: - in advanced search, choose a location in shelving location tab and start search (opac-search.pl?idx=kw&op=and&idx=kw&op=and&idx=kw&do=Search&limit=mc-loc) - 0 result - check that location exist by doing a simple search and filtering on the location facet - have some results With patch: - in advanced search, choose a location in shelving location tab and start search (opac-search.pl?idx=kw&op=and&idx=kw&op=and&idx=kw&do=Search&limit=mc-loc) - found results
Here is my alternate patch. Don't hesitate to discuss it. Kind regards ;)
Patch tested with a sandbox, by Séverine QUEUNE <severine.queune@bulac.fr>
Created attachment 93397 [details] [review] Bug 22426: Elasticsearch - Index location is missing in advanced search Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Created attachment 93398 [details] [review] Bug 22426: (alternate) Elasticsearch fix location limit in advanced search A search made on Shelving location tab in advanced search gives 0 result. Test plan : Without patch: - in advanced search, choose a location in shelving location tab and start search (opac-search.pl?idx=kw&op=and&idx=kw&op=and&idx=kw&do=Search&limit=mc-loc) - 0 result - check that location exist by doing a simple search and filtering on the location facet - have some results With patch: - in advanced search, choose a location in shelving location tab and start search (opac-search.pl?idx=kw&op=and&idx=kw&op=and&idx=kw&do=Search&limit=mc-loc) - found results Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
I am not sure which is the best fix here.
*** Bug 24109 has been marked as a duplicate of this bug. ***
The alternate patch would be my preference - the first treats mc-loc as a special case, I think it fits more to add it to the map like other mc-fields are
Created attachment 97223 [details] [review] Bug 22426: (alternate) Elasticsearch fix location limit in advanced search A search made on Shelving location tab in advanced search gives 0 result. Test plan : Without patch: - in advanced search, choose a location in shelving location tab and start search (opac-search.pl?idx=kw&op=and&idx=kw&op=and&idx=kw&do=Search&limit=mc-loc) - 0 result - check that location exist by doing a simple search and filtering on the location facet - have some results With patch: - in advanced search, choose a location in shelving location tab and start search (opac-search.pl?idx=kw&op=and&idx=kw&op=and&idx=kw&do=Search&limit=mc-loc) - found results Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 97224 [details] [review] Bug 22426: Map 'loc' to 'location' when building ES queries A search made on Shelving location tab in advanced search gives 0 result. Test plan : Without patch: - in advanced search, choose a location in shelving location tab and start search (opac-search.pl?idx=kw&op=and&idx=kw&op=and&idx=kw&do=Search&limit=mc-loc) - 0 result - check that location exist by doing a simple search and filtering on the location facet - have some results With patch: - in advanced search, choose a location in shelving location tab and start search (opac-search.pl?idx=kw&op=and&idx=kw&op=and&idx=kw&do=Search&limit=mc-loc) - found results Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nice work everyone! Pushed to master for 20.05
Pushed to 19.11.x branch for 19.11.03