<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi Trevor,
<div class=""><br class="">
</div>
<div class="">I’ve been meaning to do something like this for a while so I've made a PR to make this possible through AppConfig:</div>
<div class=""><br class="">
</div>
<div class=""><a href="https://github.com/archivesspace/archivesspace/pull/1128" class="">https://github.com/archivesspace/archivesspace/pull/1128</a></div>
<div class=""><br class="">
</div>
<div class="">My goal was deprecating our use of and_search (the fewer plugins the better generally speaking) but it should allow for what you’re doing there without having to maintain it through a plugin (I used your params for the spec). Feedback on the PR
 welcome!</div>
<div class=""><br class="">
</div>
<div class="">Separately, I do think there’s a potential gotcha with param duplication as ‘add_solr_param’ doesn’t do any filtering, but that’s the current state of things.</div>
<div class=""><br class="">
</div>
<div class="">Mark</div>
<div class=""><br class="">
</div>
<div class="">LYRASIS<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Feb 9, 2018, at 8:06 AM, Trevor Thornton <<a href="mailto:trthorn2@ncsu.edu" class="">trthorn2@ncsu.edu</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div class="">Following up on my message about the search tuning plugin I was working on - I'm done working on it and it's safe to use if you want to try it out:</div>
<div class=""><a href="https://github.com/NCSU-Libraries/archivesspace_search_title_boost" class="">https://github.com/NCSU-Libraries/archivesspace_search_title_boost</a></div>
<div class=""><br class="">
</div>
<div class="">All it does is boost search results where the words in your query all match words in the title field (which is a catch-all field for names, labels, terms, etc, not just for actual titles). It gives an extra boost to records where there is an exact
 match on the beginning of the value (e.g. a search for 'cats' will boost 'cats on parade' over 'parade of cats').</div>
<div class=""><br class="">
</div>
<div class="">One big difference between this and <a href="https://github.com/hudmol/and_search" class="">
Hudson Molonglo's and_search plugin</a> is that this one will not affect the total number of results returned but instead will just boost the relevancy score for records where all of the words in the query match the title field. Opinions will differ on which
 is better. Both plugins affect the core search that is used in the staff and public interfaces.</div>
<div class=""><br class="">
</div>
<div class="">If you're comfortable with Solr or brave enough to try to be, you can take this code and customize it for your own needs. Here's how it works - it's pretty simple (again, I borrowed this approach from HM so thanks to them):</div>
<div class=""><br class="">
</div>
<div class="">1. It's really just one file -<b class=""> backend/plugin_init.rb</b> - and in looks like this:</div>
<div class=""><br class="">
</div>
<div class=""><font face="monospace, monospace" class="">ArchivesSpaceService.loaded_hook do</font></div>
<div class=""><font face="monospace, monospace" class="">  Solr.add_search_hook do |query|</font></div>
<div class=""><font face="monospace, monospace" class=""><b class="">    query.add_solr_param('bq', "title:\"#{@query_string}\"*")</b></font></div>
<div class=""><font face="monospace, monospace" class=""><b class="">    query.add_solr_param('pf', 'title^10')</b></font></div>
<div class=""><font face="monospace, monospace" class=""><b class="">    query.add_solr_param('ps', 0)</b></font></div>
<div class=""><font face="monospace, monospace" class="">  end</font></div>
<div class=""><font face="monospace, monospace" class="">end</font></div>
<div class=""><br class="">
</div>
<div class="">2. The lines that start with <b class="">query.add_solr_param</b> each add a parameter to the Solr query and take 2 arguments (the bits inside the parentheses). The first is the parameter name and the second is the value.</div>
<div class=""><br class="">
</div>
<div class="">3. You can pass in any parameters available in the Solr <a href="https://lucene.apache.org/solr/guide/6_6/the-extended-dismax-query-parser.html" class="">
Extended DisMax Query Parser</a>, which includes parameters from the <a href="https://lucene.apache.org/solr/guide/6_6/the-dismax-query-parser.html#the-dismax-query-parser" class="">
Dismax parser</a> and the <a href="https://lucene.apache.org/solr/guide/6_6/the-standard-query-parser.html#the-standard-query-parser" class="">
Lucene parser</a>. Use appropriate caution - it's safer to use parameters that adjust the relevancy score of the results rather than the changing the overall scope of the query.</div>
<div class=""><br class="">
</div>
<div class="">4. A little more advanced:</div>
<div class=""><br class="">
</div>
<div class="">a. any instance variables defined here can be used:</div>
<div class=""><a href="https://github.com/archivesspace/archivesspace/blob/99f611ce18c4a4c27cabcd294caf32b48cb7ed06/backend/app/model/solr.rb#L63" class="">https://github.com/archivesspace/archivesspace/blob/99f611ce18c4a4c27cabcd294caf32b48cb7ed06/backend/app/model/solr.rb#L63</a></div>
<div class=""><br class="">
</div>
<div class="">b. check out the Solr schema if you need more info about what fields are available:</div>
<div class=""><a href="https://github.com/archivesspace/archivesspace/blob/master/solr/schema.xml" class="">https://github.com/archivesspace/archivesspace/blob/master/solr/schema.xml</a></div>
<div class=""><br class="">
</div>
<div class="">Let me know if you have questions and/or suggestions (or if you know more than I do about this and I got anything wrong!)</div>
<div class=""><br class="">
</div>
<div class="">-Trevor</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
</div>
<div class="gmail_extra"><br class="">
<div class="gmail_quote">On Wed, Feb 7, 2018 at 5:08 PM, Trevor Thornton <span dir="ltr" class="">
<<a href="mailto:trthorn2@ncsu.edu" target="_blank" class="">trthorn2@ncsu.edu</a>></span> wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr" class="">I've been working on a plugin (based on the approach HM used in their and_search plugin) that deals with the problem a little differently - instead of changing the default operator to AND it boosts results for phrase queries (multiple
 words separated with spaces) where there is an exact match in the Solr 'title' field:
<div class=""><br class="">
<div class=""><a href="https://github.com/NCSU-Libraries/archivesspace_search_title_boost" target="_blank" class="">https://github.com/NCSU-<wbr class="">Libraries/archivesspace_<wbr class="">search_title_boost</a><br class="">
</div>
</div>
</div>
<div class="HOEnZb">
<div class="h5">
<div class="gmail_extra"><br class="">
<div class="gmail_quote">On Wed, Feb 7, 2018 at 4:53 PM, Celia Caust-Ellenbogen <span dir="ltr" class="">
<<a href="mailto:ccauste1@swarthmore.edu" target="_blank" class="">ccauste1@swarthmore.edu</a>></span> wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr" class="">Is there a ticket for this problem, of the default OR instead of AND, yet? I couldn't find one, so I created it here, if anyone else wants to vote: <a href="https://archivesspace.atlassian.net/browse/ANW-427" target="_blank" class="">https://archivesspace.at<wbr class="">lassian.net/browse/ANW-427</a></div>
<div class="gmail_extra">
<div class="">
<div class="m_-4126624206520255181h5"><br class="">
<div class="gmail_quote">On Thu, Jan 4, 2018 at 9:45 AM, Trevor Thornton <span dir="ltr" class="">
<<a href="mailto:trthorn2@ncsu.edu" target="_blank" class="">trthorn2@ncsu.edu</a>></span> wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr" class="">We've had this problem in the staff interface. The typeahead functionality is basically useless in a lot of cases, but searching with the 'browse' modal generally works better. If you're searching for a phrase it always works better
 to wrap it in double quotes to avoid the default OR issue.</div>
<div class="gmail_extra"><br class="">
<div class="gmail_quote">
<div class="">
<div class="m_-4126624206520255181m_-8873949414944954700h5">On Tue, Jan 2, 2018 at 4:52 PM, Kevin Clair
<span dir="ltr" class=""><<a href="mailto:Kevin.Clair@du.edu" target="_blank" class="">Kevin.Clair@du.edu</a>></span> wrote:<br class="">
</div>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="">
<div class="m_-4126624206520255181m_-8873949414944954700h5">
<div lang="EN-US" link="blue" vlink="purple" class="">
<div class="m_-4126624206520255181m_-8873949414944954700m_-4527235716545052688m_-990531423728098213WordSection1">
<p class="MsoNormal">Hello,<u class=""></u><u class=""></u></p>
<p class="MsoNormal"><u class=""></u> <u class=""></u></p>
<p class="MsoNormal">We’ve noticed some peculiar behavior when adding Related Agent links to Corporate Entity records in ArchivesSpace. When typing the name of the Agent we wish to link in the Related Agents form, the typeahead drop-down list populates with
 unrelated terms. For example, if we were to try and enter a University of Denver constituent unit as the later form of a name for a different DU corporate entity, typing “university of denver” into the text field brings up a drop-down list of mostly Family
 records. This only happens when the search string contains spaces; searches on a single word bring up more or less the results we would expect.<u class=""></u><u class=""></u></p>
<p class="MsoNormal"><u class=""></u> <u class=""></u></p>
<p class="MsoNormal">Two screenshots are attached: one with the results when “university” is the search, and one with the results when “university of denver” is the search (the drop-down results are the same whether or not the period is included).<u class=""></u><u class=""></u></p>
<p class="MsoNormal"><u class=""></u> <u class=""></u></p>
<p class="MsoNormal">Has anyone else noticed anything like this?<u class=""></u><u class=""></u></p>
<p class="MsoNormal"><u class=""></u> <u class=""></u></p>
<p class="MsoNormal">thanks!  -k<u class=""></u><u class=""></u></p>
<p class="MsoNormal"><u class=""></u> <u class=""></u></p>
</div>
</div>
<br class="">
</div>
</div>
______________________________<wbr class="">_________________<br class="">
Archivesspace_Users_Group mailing list<br class="">
<a href="mailto:Archivesspace_Users_Group@lyralists.lyrasis.org" target="_blank" class="">Archivesspace_Users_Group@lyra<wbr class="">lists.lyrasis.org</a><br class="">
<a href="http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group" rel="noreferrer" target="_blank" class="">http://lyralists.lyrasis.org/m<wbr class="">ailman/listinfo/archivesspace_<wbr class="">users_group</a><br class="">
<br class="">
</blockquote>
</div>
<span class="m_-4126624206520255181m_-8873949414944954700HOEnZb"><font color="#888888" class=""><br class="">
<br clear="all" class="">
<div class=""><br class="">
</div>
-- <br class="">
<div class="m_-4126624206520255181m_-8873949414944954700m_-4527235716545052688gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div dir="ltr" class="">
<div dir="ltr" class=""><font size="2" style="background-color:rgb(255,255,255)" color="#666666" class="">Trevor Thornton</font>
<div class=""><font size="2" style="background-color:rgb(255,255,255)" color="#666666" class="">Applications Developer, Digital Library Initiatives</font></div>
<div class=""><font size="2" style="background-color:rgb(255,255,255)" color="#666666" class="">North Carolina State University Libraries</font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</font></span></div>
<br class="">
______________________________<wbr class="">_________________<br class="">
Archivesspace_Users_Group mailing list<br class="">
<a href="mailto:Archivesspace_Users_Group@lyralists.lyrasis.org" target="_blank" class="">Archivesspace_Users_Group@lyra<wbr class="">lists.lyrasis.org</a><br class="">
<a href="http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group" rel="noreferrer" target="_blank" class="">http://lyralists.lyrasis.org/m<wbr class="">ailman/listinfo/archivesspace_<wbr class="">users_group</a><br class="">
<br class="">
</blockquote>
</div>
<br class="">
<br clear="all" class="">
<div class=""><br class="">
</div>
-- <br class="">
</div>
</div>
<span class="m_-4126624206520255181HOEnZb"><font color="#888888" class="">
<div class="m_-4126624206520255181m_-8873949414944954700gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class=""><font size="1" class="">Celia Caust-Ellenbogen </font>
<div class=""><a href="http://swarthmore.edu/friends-historical-library" target="_blank" class=""><font size="1" class="">Friends Historical Library of Swarthmore College</font></a></div>
<div class=""><font size="1" class=""><a href="tel:(610)%20328-8496" value="+16103288496" target="_blank" class="">610-328-8496</a></font></div>
<div class=""><a href="mailto:ccauste1@swarthmore.edu" style="font-size:x-small" target="_blank" class="">ccauste1@swarthmore.edu</a></div>
<div class=""><font size="1" class="">she/her/hers</font></div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</font></span></div>
<br class="">
______________________________<wbr class="">_________________<br class="">
Archivesspace_Users_Group mailing list<br class="">
<a href="mailto:Archivesspace_Users_Group@lyralists.lyrasis.org" target="_blank" class="">Archivesspace_Users_Group@lyra<wbr class="">lists.lyrasis.org</a><br class="">
<a href="http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group" rel="noreferrer" target="_blank" class="">http://lyralists.lyrasis.org/m<wbr class="">ailman/listinfo/archivesspace_<wbr class="">users_group</a><br class="">
<br class="">
</blockquote>
</div>
<br class="">
<br clear="all" class="">
<div class=""><br class="">
</div>
-- <br class="">
<div class="m_-4126624206520255181gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div dir="ltr" class="">
<div dir="ltr" class=""><font size="2" style="background-color:rgb(255,255,255)" color="#666666" class="">Trevor Thornton</font>
<div class=""><font size="2" style="background-color:rgb(255,255,255)" color="#666666" class="">Applications Developer, Digital Library Initiatives</font></div>
<div class=""><font size="2" style="background-color:rgb(255,255,255)" color="#666666" class="">North Carolina State University Libraries</font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
<br clear="all" class="">
<div class=""><br class="">
</div>
-- <br class="">
<div class="gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div dir="ltr" class="">
<div dir="ltr" class=""><font size="2" style="background-color:rgb(255,255,255)" color="#666666" class="">Trevor Thornton</font>
<div class=""><font size="2" style="background-color:rgb(255,255,255)" color="#666666" class="">Applications Developer, Digital Library Initiatives</font></div>
<div class=""><font size="2" style="background-color:rgb(255,255,255)" color="#666666" class="">North Carolina State University Libraries</font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
_______________________________________________<br class="">
Archivesspace_Users_Group mailing list<br class="">
<a href="mailto:Archivesspace_Users_Group@lyralists.lyrasis.org" class="">Archivesspace_Users_Group@lyralists.lyrasis.org</a><br class="">
http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>