Bug 18316: Add weighting/relevancy options to ES query on simple search
authorNick Clemens <nick@bywatersolutions.com>
Wed, 21 Mar 2018 13:27:12 +0000 (13:27 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Wed, 7 Nov 2018 22:00:30 +0000 (22:00 +0000)
commitfa853f7d38a5addafe21fb3cabdaaa9cc692bb12
tree4925af9d20f01740638beb75b975da85166492fc
parent5f0bc6e457f19b889d5f12ee92d6ca5e5effdf42
Bug 18316: Add weighting/relevancy options to ES query on simple search

The idea is the following: if some search field(s) are weighted in
search engine config page, Koha will query ES on all fields plus those with
the coresponding weights. Else, search is done on the entire record with
no weighting. The advanced search page is unaffected by these changes

Test plan (having Koha working with Elasticsearch):
  - apply this patch
  - have some weights defined for various fields
  - try searches from the search bar and from the advanced search page
  - confirm weighting affects the relevancy (in expected ways)
      e.g.
      1. search for 'a' from advanced search, note results
      2. give 'title' a weight
      3. search for 'a' using the simple search bar
      4. results with 'a' in the title should now be more relevant
  - confirm search results on advanced search page are unaffected

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Koha/SearchEngine/Elasticsearch/QueryBuilder.pm
Koha/SearchFields.pm
catalogue/search.pl
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt
t/db_dependent/Koha/SearchField.t