Some libraries would like to be able to prioritize "books" over "large print" , audios, etc in the search results
Providing a way to organize the different formats for a title would provide an expected and reliable results display. It would improve searching for both patrons and staff.
Assigning "weight" values to items would be a huge timesaver and alleviate a lot of patron frustrations. Our patrons will often put a hold on a large print book simply because it shows up first in their search. Invariably they didn't want the large print and are mad and disappointed.
Created attachment 146585 [details] [review] [Do not push] - Experimental support for function_score We've been experimenting a bit with function_score query in our ES-searches as we're having the same problems with not very relevant records showing high in the results. The patch allows us to assign different function_score-functions to promote/demote records in the resultlist. It's a bit of work in progress but if someone wants to try it out: Apply patch Create a Local use syspref, ElasticsearchFunctionScore , textarea Fill in syspref with yaml representing av array of function scores as understood by ES. Eg(modify itype to local condidtions): - filter: match: itype: "3" weight: 1.5
More interesting things can be done eg. maths: In this case we want to promote newer books over older. So define a new numeric field 'pubyear-numeric' in the ES mappings and map it to 008/07-10. After some existance- and sanity-checking we weight records (in this case) newer than 1980 higher. - script_score: script: source: "long y = doc['pubyear-numeric'].size()==0 ? params.start : doc['pubyear-numeric'].value; y = (y<params.start || y>2100) ? params.start : y; return (y-params.start)/params.divider+1;" params: start: 1980 divider: 20
This would be great! We often get random items like cake pans, kits, etc. near the top of our search results, which can be frustrating. More customization for search weights would be fantastic.