<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body>A new request with request id 12332 has been created by koha-devel-request@lists.koha-community.org. Short info on the request is : <br><br>Title : Koha-devel Digest, Vol 195, Issue 15<br>Category : <br>Description : <div>Send Koha-devel mailing list submissions to<br>    koha-devel@lists.koha-community.org<br><br>To subscribe or unsubscribe via the World Wide Web, visit<br>    https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel<br>or, via email, send a message with subject or body 'help' to<br>    koha-devel-request@lists.koha-community.org<br><br>You can reach the person managing the list at<br>    koha-devel-owner@lists.koha-community.org<br><br>When replying, please edit your Subject line so it is more specific<br>than "Re: Contents of Koha-devel digest..."<br><br><br>Today's Topics:<br><br>   1. Re: Elasticsearch query with suppress:false not returning<br>      expected results (Philippe Blouin)<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Wed, 23 Feb 2022 15:52:33 -0500<br>From: Philippe Blouin <philippe.blouin@inlibro.com><br>To: Kevin Carnes <kevin.carnes@ub.lu.se>,<br>    "koha-devel@lists.koha-community.org"<br>    <koha-devel@lists.koha-community.org><br>Subject: Re: [Koha-devel] Elasticsearch query with suppress:false not<br>    returning expected results<br>Message-ID: <548eb735-8a4b-773d-3384-8c3f648fe71e@inlibro.com><br>Content-Type: text/plain; charset="utf-8"; Format="flowed"<br><br>Hi Kevin,<br><br>You were right, one of the indexed record was "hidden" so the second <br>result was correct (24 Acceptabilité + 1 Expropriation).  I skipped it <br>thinking the 25 was actually just 25 "acceptabilité" returned.<br><br><br>Now, writting the query differently does it.<br><br>  *<br>    (title:acceptabilité) OR (title:expropriation)<br>    ANDsuppress:false        1 résultat<br>  *<br>    ((title:acceptabilité) OR (title:expropriation))<br>    ANDsuppress:false      25 résultats<br><br>But it's not what Koha is doing.  Can I interpret that this is a bug I <br>should open and provide a fix for ?<br><br><br>Thanks a lot,<br><br>Philippe<br><br><br><br>On 2022-02-18 09:33, Kevin Carnes wrote:<br>> Hi Philippe,<br>><br>> Your second query appears to be correct. Is it possible that one of <br>> the "expropriation" records is suppressed in the the OPAC? Try <br>> searching for "title:expropriation AND suppress:true" (without <br>> QueryAutoTruncate).<br>><br>> It's possible to automatically add parentheses to both the query and <br>> the limits by editing the <br>> Koha/SearchEngine/Elasticsearch/QueryBuilder.pm file. After <br>> "$search_param_query_str = join( ' ', <br>> $self->_create_query_string(@search_params) );" add:<br>>         if ($search_param_query_str) {<br>>             $search_param_query_str = "($search_param_query_str)";<br>>         }<br>>         my $search_param_limits_str = $self->_join_queries( <br>> $self->_convert_index_strings(@$limits) );<br>>         if ($search_param_limits_str) {<br>>             $search_param_limits_str = "($search_param_limits_str)";<br>>         }<br>><br>> And then change the "$query_str" to:<br>>         $query_str = join( ' AND ',<br>>             $search_param_query_str || (),<br>>             $search_param_limits_str || () );<br>><br>> Hopefully that will produce the correct results.<br>><br>> Regards,<br>> Kevin<br>><br>> _______________________________________________<br>> Koha-devel mailing list<br>> Koha-devel@lists.koha-community.org<br>> https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel<br>> website :https://www.koha-community.org/<br>> git :https://git.koha-community.org/<br>> bugs :https://bugs.koha-community.org/<br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20220223/bebeda42/attachment-0001.htm><br><br>------------------------------<br><br>Subject: Digest Footer<br><br>_______________________________________________<br>Koha-devel mailing list<br>Koha-devel@lists.koha-community.org<br>https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel<br>website : https://www.koha-community.org/<br>git : https://git.koha-community.org/<br>bugs : https://bugs.koha-community.org/<br><br><br>------------------------------<br><br>End of Koha-devel Digest, Vol 195, Issue 15<br>*******************************************<br></div><br><br>NOTE: You are receiving this mail because, the Requester/Technician wanted you to get notified on this request creation.<br></body></html>