Bug 11069: increase title ranking in relevance when using QueryWeightFields
authorFridolyn SOMERS <fridolyn.somers@biblibre.com>
Thu, 17 Oct 2013 14:20:49 +0000 (16:20 +0200)
committerGalen Charlton <gmc@esilibrary.com>
Sat, 19 Apr 2014 14:45:51 +0000 (14:45 +0000)
commit2c658d882a5ca43c107c26396b09f11ad6e69f9b
tree843b74e7ca5929ff57928ec3bfe6491f9e7ebe18
parent4a32a188ae0a1bf189d3e1a4865051400c39b31e
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>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Relevance ranking and field weighting are hard to test,
as many MARC fields are indexed into the used indexes.
If we had an index that only indexed 245$a/200$a the
effect might be more visible.
I found no regressions by this patch, change reads
logical.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
C4/Search.pm