<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
  </head>
  <body>
    <p>I think your problem is here:</p>
    <p><br>
    </p>
    <p><a class="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><br>
    </p>
    <p>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><br>
    </p>
    <p>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><br>
    </p>
    <p><a class="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><br>
    </p>
    <p>But I don't know how you'd go about triggering that.<br>
    </p>
    <p><br>
    </p>
    <p>Andrew.</p>
    <p><br>
    </p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 03/03/2021 09:18, Nick Butler wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:LO4P265MB3823FB67AEAA84C3CA18C011B0989@LO4P265MB3823.GBRP265.PROD.OUTLOOK.COM">
      
      <style type="text/css" style="display:none;">P {margin-top:0;margin-bottom:0;}</style>
      <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="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b>
            <a class="moz-txt-link-abbreviated" href="mailto:archivesspace_users_group-bounces@lyralists.lyrasis.org">archivesspace_users_group-bounces@lyralists.lyrasis.org</a>
            <a class="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="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="moz-txt-link-abbreviated" href="mailto:archivesspace_users_group@lyralists.lyrasis.org">archivesspace_users_group@lyralists.lyrasis.org</a>
            <a class="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;">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" moz-do-not-send="true">
              do it yourself</a>.</p>
          <p style="margin-top: 0px; margin-bottom: 0px;"><br>
          </p>
          <p style="margin-top: 0px; margin-bottom: 0px;">Andrew.<br>
          </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 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_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" moz-do-not-send="true">Archivesspace_Users_Group@lyralists.lyrasis.org</a>
<a class="x_moz-txt-link-freetext" href="http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group" moz-do-not-send="true">http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group</a>
</pre>
          </blockquote>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Archivesspace_Users_Group mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Archivesspace_Users_Group@lyralists.lyrasis.org">Archivesspace_Users_Group@lyralists.lyrasis.org</a>
<a class="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>
  </body>
</html>