<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F4E79;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:906917179;
        mso-list-template-ids:1400949562;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:1.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:"Courier New";
        mso-bidi-font-family:"Times New Roman";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:1.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:2.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:2.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:3.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:3.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:4.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:4.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style>
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">This is super useful!<br>
<br>
One caveat re bq being space separated, that’s only true IF you have q.op unset or set explicitly to “OR” – if you change q.op, it affects bq identically to q, so the boost queries will become ANDed as well, and since nothing can have multiple primary types,
 the bq will do nothing.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">--<o:p></o:p></p>
<p class="MsoNormal">Dave Mayo (he/him)<o:p></o:p></p>
</div>
<p class="MsoNormal">Senior Digital Library Software Engineer<br>
Harvard University > HUIT > LTS<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black"><archivesspace_users_group-bounces@lyralists.lyrasis.org> on behalf of Andrew Morrison <andrew.morrison@bodleian.ox.ac.uk><br>
<b>Reply-To: </b>Archivesspace Users Group <archivesspace_users_group@lyralists.lyrasis.org><br>
<b>Date: </b>Thursday, January 9, 2020 at 5:21 AM<br>
<b>To: </b>Archivesspace Users Group <archivesspace_users_group@lyralists.lyrasis.org><br>
<b>Subject: </b>Re: [Archivesspace_Users_Group] question about customizing search features in the ArchivesSpace PUI<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Some additional notes on relevance-rank boosting:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<ul type="disc">
<li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo1">
When experimenting with different boost values, you have to restart after each change to config.rb (just the backend in a developer system, but in a system running a pre-built release you have to restart the whole thing, which gets tiresome).<o:p></o:p></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo1">
If you know how to access the Solr web interface (how depends on your setup) then it is quicker to play around with different boosts using that, before copying them into the ArchivesSpace config for final testing. To approximately simulate a simple keyword
 search in the public user interface, for example searching all records for the keyword "cheese", set q to
<i>fullrecord:cheese</i>, set fq to <i>types:pui</i>, set fl to <i>primary_type,title</i>, select
<i>edismax</i>, then enter your boosts in the bf field.<o:p></o:p></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo1">
bq can be space-separated instead of using OR.<o:p></o:p></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo1">
If you literally want any search query to return all archival objects first, even ones that only match the keyword once deep inside a note, before any collections even ones which contain the keyword dozens of times, and then all other record types last, even
 if their title is a precise match, then boost factors like 50 and 100 are appropriate. For a more subtle bias towards certain record types, without them totally dominating, start low and work upwards (the smallest boost you can apply is 1.1).<o:p></o:p></li></ul>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Andrew.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">On Wed, 2020-01-08 at 15:39 +0000, Mayo, Dave wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Hi Henry!<br>
<br>
So, good news! As long as you’re on a reasonably current version of ASpace, you can change order by primary type purely via configuration.<br>
<br>
The way you’d do it is by setting the bq param in AppConfig[:solr_params] – here’s what we’ve got in production right now (we’re setting q.op also, because we wanted the default search operator to be AND:<br>
<br>
AppConfig[:solr_params] = { "q.op" => "AND", "bq" => proc { "primary_type:resource^100 OR primary_type:accession^100 OR primary_type:subject^50 OR primary_type:agent_person^50 OR primary_type:agent_corporate_entity^30 OR primary_type:agent_family^30" }}<br>
<br>
To set it how you’d like it, you could take our BQ and adjust the values so that AOs > collections > etc., e.g.:<br>
<br>
AppConfig[:solr_params] = {“bq” => proc { “primary_type:archival_object^100 OR primary_type:resource^50” }<br>
<br>
This is assuming you don’t care about sort order for other types, but fill in however many you want and adjust boost increments (the number after ^) to suit.
<br>
<br>
For more info on how bq works, consult the docs for Solr’s dismax parser: <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__lucene.apache.org_solr_guide_6-5F6_the-2Ddismax-2Dquery-2Dparser.html&d=DwMGaQ&c=WO-RGvefibhHBZq3fL85hQ&r=_Mv1dY22K7jvT5MD7xjbvGVzRDOUMhx4WYcnPSIzYnE&m=4qxuV7g4RP-HIbimkIt2sAOG2pUqvutYsjt5uuWjYik&s=GHSTumGgJkdaEBsAJFe-dMlXts0xBKmeqbuFbjaA7QE&e=">
https://lucene.apache.org/solr/guide/6_6/the-dismax-query-parser.html</a><br>
<br>
Note that in Solr it’s normal to pass multiple bq parameters if you want to boost multiple things, but prior to  2.6.0, solr_params didn’t support it, so one “bq” with a query using OR is a workaround.<br>
<br>
If you’re on 2.6.0 or higher, you can do:<br>
<br>
AppConfig[:solr_params] = {“bq” => [ ‘primary_type:archival_object^100’, ‘primary_type:resource^50’]}<br>
<br>
which is technically “cleaner” by solr standards, but is equivalent in function as far as I can tell.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<p class="MsoNormal">--<o:p></o:p></p>
<p class="MsoNormal">Dave Mayo (he/him)<o:p></o:p></p>
</div>
<p class="MsoNormal">Senior Digital Library Software Engineer<br>
Harvard University > HUIT > LTS<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black"><archivesspace_users_group-bounces@lyralists.lyrasis.org> on behalf of "Steele, Henry" <Henry.Steele@tufts.edu><br>
<b>Reply-To: </b>Archivesspace Users Group <archivesspace_users_group@lyralists.lyrasis.org><br>
<b>Date: </b>Tuesday, January 7, 2020 at 5:08 PM<br>
<b>To: </b>Archivesspace Users Group <archivesspace_users_group@lyralists.lyrasis.org><br>
<b>Subject: </b>[Archivesspace_Users_Group] question about customizing search features in the ArchivesSpace PUI</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<p class="MsoNormal"><span style="color:#1F4E79">Good afternoon,</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F4E79"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F4E79">I work at Tufts University in cooperation with the Digital Collections & Archives.   I am working on various changes to the public user interface.  Many of you helped with questions before, which were a great
 help!</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F4E79"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F4E79">There’s a change we want to make to search results.   I suspect it may involve getting into controllers and the functioning of ASpace, but I wanted to check, and ask if anyone has a plugin that does this sort
 of thing.  </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F4E79"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F4E79">We want to change the sort options for search results so that archival objects appear at the top, then collections, then everything else.  So by json_modeltype, with two of the highest precedence.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F4E79"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F4E79">I thought of doing this in jquery, but this wouldn’t work because that would only sort the results on the page.  
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F4E79"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F4E79">This may require development, but I wondered if someone had a direction to point me in, or if they had a plugin that could be modified. 
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F4E79"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F4E79">Thanks</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F4E79"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F4E79">Henry Steele</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F4E79">Systems Librarian</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F4E79">Tufts University Library Technology Services</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F4E79">(617)627-5239</span><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>Archivesspace_Users_Group mailing list<o:p></o:p></pre>
<pre><a href="mailto:Archivesspace_Users_Group@lyralists.lyrasis.org">Archivesspace_Users_Group@lyralists.lyrasis.org</a><o:p></o:p></pre>
<pre><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lyralists.lyrasis.org_mailman_listinfo_archivesspace-5Fusers-5Fgroup&d=DwMGaQ&c=WO-RGvefibhHBZq3fL85hQ&r=_Mv1dY22K7jvT5MD7xjbvGVzRDOUMhx4WYcnPSIzYnE&m=4qxuV7g4RP-HIbimkIt2sAOG2pUqvutYsjt5uuWjYik&s=tIbNoSGOd_gkCZLsn59iqC1tS4belCsPKslryOeyBfs&e=">http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group</a><o:p></o:p></pre>
</blockquote>
</div>
</body>
</html>