<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Andrew,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thank you very much, that sounds like an excellent solution. I'd tried tweaking the advanced_query_string model in a development instance without reliable success, but simply converting the colons to spaces ought to work nicely.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Many thanks again,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Nick<br>
</div>
<div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> archivesspace_users_group-bounces@lyralists.lyrasis.org <archivesspace_users_group-bounces@lyralists.lyrasis.org> on behalf of Andrew Morrison
 <andrew.morrison@bodleian.ox.ac.uk><br>
<b>Sent:</b> 04 March 2021 11:44<br>
<b>To:</b> archivesspace_users_group@lyralists.lyrasis.org <archivesspace_users_group@lyralists.lyrasis.org><br>
<b>Subject:</b> Re: [Archivesspace_Users_Group] Searches including colons</font>
<div> </div>
</div>
<div>
<p style="margin-top: 0px; margin-bottom: 0px;">Probably the easiest fix would be to change your plug-in so that it convert colons to spaces when indexing this new field.<br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;"><br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;">Andrew.</p>
<p style="margin-top: 0px; margin-bottom: 0px;"><br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;"><br>
</p>
<div class="x_moz-cite-prefix">On 04/03/2021 11:21, Andrew Morrison wrote:<br>
</div>
<blockquote type="cite">
<p style="margin-top: 0px; margin-bottom: 0px;">I think your problem is here:</p>
<p style="margin-top: 0px; margin-bottom: 0px;"><br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;"><a class="x_moz-txt-link-freetext" href="https://github.com/archivesspace/archivesspace/blob/4554d0b8bb47558f18bbcae2f63bea84effc9b28/backend/app/model/advanced_query_string.rb#L84-L95">https://github.com/archivesspace/archivesspace/blob/4554d0b8bb47558f18bbcae2f63bea84effc9b28/backend/app/model/advanced_query_string.rb#L84-L95</a></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;">The backend, when converting the "advanced_query" data structures the PUI and SUI send it into Solr queries, is stripping out colons. That might work if the index field were "text_general" but for a "string" type
 Solr does no tokenization, so matches have to be exact.<br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;"><br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;">If you look further up in the same file, it will escape colons, which is what you want, if this condition is met:<br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;"><br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;"><a class="x_moz-txt-link-freetext" href="https://github.com/archivesspace/archivesspace/blob/4554d0b8bb47558f18bbcae2f63bea84effc9b28/backend/app/model/advanced_query_string.rb#L54">https://github.com/archivesspace/archivesspace/blob/4554d0b8bb47558f18bbcae2f63bea84effc9b28/backend/app/model/advanced_query_string.rb#L54</a></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;">But I don't know how you'd go about triggering that.<br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;"><br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;">Andrew.</p>
<p style="margin-top: 0px; margin-bottom: 0px;"><br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;"><br>
</p>
<div class="x_moz-cite-prefix">On 03/03/2021 09:18, Nick Butler wrote:<br>
</div>
<blockquote type="cite">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Hi Andrew,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
We've added it to the PUI and SUI advanced search, in what I believe to be the standard manner (for the SUI, adding a line to search_definitions.rb, and for the PUI adding it to the :field_options arrays in the locals for the shared/search partial, in both
 the PUI search/search_results and welcome/show views). It's a *_u_sstr field, if that makes a difference, and we're storing multiple values in it. Exact (or wildcard) searches for any of the values being stored in the field are returning correct matches, except
 (as far as we can tell) when the searches contain colons, when they uniformly return no results.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Many thanks,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Nick<br>
</div>
<div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b>
<a class="x_moz-txt-link-abbreviated" href="mailto:archivesspace_users_group-bounces@lyralists.lyrasis.org">
archivesspace_users_group-bounces@lyralists.lyrasis.org</a> <a class="x_moz-txt-link-rfc2396E" href="mailto:archivesspace_users_group-bounces@lyralists.lyrasis.org">
<archivesspace_users_group-bounces@lyralists.lyrasis.org></a> on behalf of Andrew Morrison
<a class="x_moz-txt-link-rfc2396E" href="mailto:andrew.morrison@bodleian.ox.ac.uk">
<andrew.morrison@bodleian.ox.ac.uk></a><br>
<b>Sent:</b> 02 March 2021 16:44<br>
<b>To:</b> <a class="x_moz-txt-link-abbreviated" href="mailto:archivesspace_users_group@lyralists.lyrasis.org">
archivesspace_users_group@lyralists.lyrasis.org</a> <a class="x_moz-txt-link-rfc2396E" href="mailto:archivesspace_users_group@lyralists.lyrasis.org">
<archivesspace_users_group@lyralists.lyrasis.org></a><br>
<b>Subject:</b> Re: [Archivesspace_Users_Group] Searches including colons</font>
<div> </div>
</div>
<div>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
How are you searching this field? If you've added it to the options in the PUI or SUI advanced search, it should be escaping the colon for you. If searching via the API, you probably need to
<a href="https://lucene.apache.org/core/8_0_0/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#Escaping_Special_Characters">
do it yourself</a>.</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
<br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
Andrew.<br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
<br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
<br>
</p>
<div class="x_x_moz-cite-prefix">On 02/03/2021 15:01, Nick Butler wrote:<br>
</div>
<blockquote type="cite">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Hi all,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
We're currently experimenting with creating a new index field (a StrField) for alternative forms of our resource and archival object identifiers. This field is largely working fine and behaving as expected, but over the course of testing this work out we've
 noticed that searches including colons don't appear to return any results, even when the exact content of the index field is used (with or without quotation marks around the whole search). Have other people experienced something similar? Is there a known workaround?</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Many thanks,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Nick<br>
</div>
<br>
<fieldset class="x_x_mimeAttachmentHeader"></fieldset>
<pre class="x_x_moz-quote-pre">_______________________________________________
Archivesspace_Users_Group mailing list
<a class="x_x_moz-txt-link-abbreviated" href="mailto:Archivesspace_Users_Group@lyralists.lyrasis.org">Archivesspace_Users_Group@lyralists.lyrasis.org</a>
<a class="x_x_moz-txt-link-freetext" href="http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group">http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group</a>
</pre>
</blockquote>
</div>
</div>
<br>
<fieldset class="x_mimeAttachmentHeader"></fieldset>
<pre class="x_moz-quote-pre">_______________________________________________
Archivesspace_Users_Group mailing list
<a class="x_moz-txt-link-abbreviated" href="mailto:Archivesspace_Users_Group@lyralists.lyrasis.org">Archivesspace_Users_Group@lyralists.lyrasis.org</a>
<a class="x_moz-txt-link-freetext" href="http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group">http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group</a>
</pre>
</blockquote>
<br>
<fieldset class="x_mimeAttachmentHeader"></fieldset>
<pre class="x_moz-quote-pre">_______________________________________________
Archivesspace_Users_Group mailing list
<a class="x_moz-txt-link-abbreviated" href="mailto:Archivesspace_Users_Group@lyralists.lyrasis.org">Archivesspace_Users_Group@lyralists.lyrasis.org</a>
<a class="x_moz-txt-link-freetext" href="http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group">http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group</a>
</pre>
</blockquote>
</div>
</div>
</body>
</html>