Bugzilla – Attachment 99141 Details for
Bug 12430
Relevance ranking should also be used without QueryWeightFields system preference
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12430: Force relevance ranking when not using QueryParser
Bug-12430-Force-relevance-ranking-when-not-using-Q.patch (text/plain), 2.43 KB, created by
David Cook
on 2020-02-18 02:38:28 UTC
(
hide
)
Description:
Bug 12430: Force relevance ranking when not using QueryParser
Filename:
MIME Type:
Creator:
David Cook
Created:
2020-02-18 02:38:28 UTC
Size:
2.43 KB
patch
obsolete
>From a7627836ba4d1f6efd98049c06093cabbdc17b11 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Tue, 17 Jun 2014 16:59:32 +1000 >Subject: [PATCH] Bug 12430: Force relevance ranking when not using QueryParser > >The system preference "QueryWeightFields" is mutually exclusive with >the system preference "QueryAutoTruncate" and the * truncation >modifier, when not using QueryParser. > >If you use truncation, relevance won't work anymore. (N.B. Relevance >doesn't work probably when using QueryParser, but for a very different >reason beyond the current scope of this bug.) > >This patch adds relevance ranking when using truncation (or basically >when QueryWeightFields is disabled). > >_TEST PLAN_ > >1) Turn on "QueryWeightFields" and set "QueryAutoTruncate" to auto >2) Turn off "UseQueryParser" >3) Do a keyword search in the OPAC >4) Note that the results are ordered by biblionumber ascending > >5) Apply patch > >6) Do the same keyword search in the OPAC >7) Note that the results are never ordered differently >(presumably in relevance order :P) > >If you're a stickler, throw in some warns so that you can see >what CCL query is being sent to Zebra. > >Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > C4/Search.pm | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > >diff --git a/C4/Search.pm b/C4/Search.pm >index 232641d7ab..56001fbe1d 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -1661,6 +1661,13 @@ sub buildQuery { > > warn "FIELD WEIGHTED OPERAND: >$weighted_operand<" if $DEBUG; > >+ #Use relevance ranking when not using a weighted query (which adds relevance ranking of its own) >+ >+ #N.B. Truncation is mutually exclusive with Weighted Queries, >+ #so even if QueryWeightFields is turned on, QueryAutoTruncate will turn it off, thus >+ #the need for this relevance wrapper. >+ $operand = "(rk=($operand))" unless $weight_fields; >+ > ($query,$query_cgi,$query_desc,$previous_operand) = _build_initial_query({ > query => $query, > query_cgi => $query_cgi, >@@ -1673,7 +1680,6 @@ sub buildQuery { > indexes_set => $indexes_set, > previous_operand => $previous_operand, > }); >- > } #/if $operands > } # /for > } >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12430
:
28880
|
96167
|
98188
|
98619
|
99141
|
99142
|
99158
|
114129
|
114130
|
114131
|
114132
|
114137
|
114138
|
114200
|
114205
|
114275