Bug 11069 - increase title ranking in relevance when using QueryWeightFields
Summary: increase title ranking in relevance when using QueryWeightFields
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Fridolin Somers
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-17 14:20 UTC by Fridolin Somers
Modified: 2015-06-04 23:30 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 11069 - increase title ranking in relevance when using QueryWeightFields (1.80 KB, patch)
2013-10-17 14:34 UTC, Fridolin Somers
Details | Diff | Splinter Review
Attachment to Bug 11069 - increase title ranking in relevance when using QueryWeightFields (1.86 KB, patch)
2014-03-11 10:15 UTC, Jesse Maseto
Details | Diff | Splinter Review
PASSED-QA-Bug-11069-increase-title-ranking-in-relevance-when-using-QueryWeightFields (2.16 KB, patch)
2014-04-19 09:09 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2013-10-17 14:20:05 UTC
when using QueryWeightFields to add ranking on a search without index, the search actually uses: 
 - rank 1 : Title-cover,ext :  exact title-cover
 - rank 2 : ti,ext : exact title
 - rank 3 : Title-cover,phr : phrase title-cover
 - rank >7 : queries without index
This relevance sets title as phrase in priority and then any index.
I propose to add title as words list before search on any index, so that records with all searched terms in title, even not well ordered, are more relevant.
Comment 1 Fridolin Somers 2013-10-17 14:34:39 UTC Comment hidden (obsolete)
Comment 2 I'm just a bot 2013-10-30 07:15:50 UTC
Patch applied cleanly, go forth and signoff
Comment 3 Mathieu Saby 2013-11-29 20:05:47 UTC
Good idea.
I'm testing it.
But don't you think that after titles, "author" and "subject" could have a specific weight more important than other indexes?

Mathieu
Comment 4 Mathieu Saby 2013-11-29 20:14:24 UTC
I'm not sure it is working.
I entered "grands moderne"
I had 3 record.

The 1st is "Alberto Giacometti", in the series "Collection des grands peintres modernes" (field 225) and "Collection des grands peintres classiques" (field 410)

The 2d is "Les grands courants de la linguistique moderne"

The 3rd is "Miro" in the series "Collection des grands peintres modernes" (only in 225)

Why the 2d isn't before the 1st?

Mathieu
Comment 5 Fridolin Somers 2013-12-02 10:08:50 UTC
(In reply to mathieu saby from comment #4)
You are looking at 225 and 410 fields. In default config those fields are indexed has "Title-series".
This patch manages only "Title" index.
Comment 6 Mathieu Saby 2013-12-02 12:21:44 UTC
(In reply to Fridolin SOMERS from comment #5)
> (In reply to mathieu saby from comment #4)
> You are looking at 225 and 410 fields. In default config those fields are
> indexed has "Title-series".
> This patch manages only "Title" index.

Yes, that's what I understood, but in your 1st message you wrote
"so that records with all searched terms in title, even not well ordered, are more relevant."
So I imagined that if there are 3 records, with the 200 field of one them matching the searched terms, and only 225/410 fields matching in the 2 others, the record with the 200 matching the search terms would be the 1st in the results.

But I suppose the algorithm is more complex than that (and the core of it is hardcoded in Zebra, isn't it?)

Mathieu
Comment 7 Mathieu Saby 2013-12-02 12:22:40 UTC
By the way, does your patch works with QueryParser? Or does QP calculate relevance differently?

Mathieu
Comment 8 Fridolin Somers 2013-12-04 07:59:52 UTC
(In reply to mathieu saby from comment #6)
The "Title" index is by default set on many fields, not only 200. Maybe your 1st result matches "grands moderne" in other fields.
Comment 9 Jesse Maseto 2014-03-11 10:15:05 UTC Comment hidden (obsolete)
Comment 10 Katrin Fischer 2014-04-19 09:08:08 UTC
Git bz doesn't like me today... doing this the old way.
Comment 11 Katrin Fischer 2014-04-19 09:09:21 UTC
Created attachment 27303 [details] [review]
PASSED-QA-Bug-11069-increase-title-ranking-in-relevance-when-using-QueryWeightFields
Comment 12 Galen Charlton 2014-04-19 14:51:26 UTC
Pushed to master.  Thanks, Fridolin!
Comment 13 Fridolin Somers 2014-08-06 12:31:41 UTC
Pushed to 3.14.x, will be in 3.14.10