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.
Created attachment 22028 [details] [review] Bug 11069 - increase title ranking in relevance when using QueryWeightFields See commit message
Patch applied cleanly, go forth and signoff
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
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
(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.
(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
By the way, does your patch works with QueryParser? Or does QP calculate relevance differently? Mathieu
(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.
Created attachment 26064 [details] [review] Attachment to Bug 11069 - increase title ranking in relevance when using QueryWeightFields [SIGNED-OFF] Bug 11069 - increase title ranking in relevance when using QueryWeightFields 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. This patch adds 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. Test plan : - Enable QueryWeightFields syspref - Perform a search, with sort by relevance, with two words ofen contained in title, but never one near the other. For example : 'History France' => Records with both words in title are first. For example : "Histoire de France" and "La France : 100 ans d'histoire" Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Git bz doesn't like me today... doing this the old way.
Created attachment 27303 [details] [review] PASSED-QA-Bug-11069-increase-title-ranking-in-relevance-when-using-QueryWeightFields
Pushed to master. Thanks, Fridolin!
Pushed to 3.14.x, will be in 3.14.10