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