<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body>
<p>The search endpoints of the ArchivesSpace API allow passing of
queries to Solr, but only selected parameters such as q and sort
are passed directly through. Sorry if I gave you the wrong
impression in previous emails.</p>
<p><br>
</p>
<p>You cannot specify qf in an API search. Instead, its value is
hardcoded here:</p>
<p><br>
</p>
<p><a class="moz-txt-link-freetext" href="https://github.com/archivesspace/archivesspace/blob/master/backend/app/model/solr.rb#L278">https://github.com/archivesspace/archivesspace/blob/master/backend/app/model/solr.rb#L278</a><br>
</p>
<p><br>
</p>
<p>A few lines further down you can see where it calls hooks, which
can be set up in plug-ins. So you can override the qf that way,
but doing so will apply to all searches everywhere (in the public
user interface and staff interface) not just specific API calls.
Alternatively, it might be possible to write a plugin to create a
new endpoint to allow dynamic setting qf, if it is crucial for
your use-case.<br>
</p>
<p><br>
</p>
<p>Some Solr parameters have equivalents in the ArchivesSpace API,
which are listed here:</p>
<p><br>
</p>
<p><a class="moz-txt-link-freetext" href="https://archivesspace.github.io/archivesspace/api/#search-this-repository">https://archivesspace.github.io/archivesspace/api/#search-this-repository</a></p>
<p><br>
</p>
<p>For example, instead of fl there is the fields[] parameter. And,
although it is missing from the documentation, you can do fq,
except it is renamed filter_query[]. The defType is already set to
edismax. Instead of rows you have to use page_size, but if you
want 1000 hits per page then you need to change
AppConfig[:max_page_size] in config.rb.<br>
</p>
<p><br>
</p>
<p>The summary field can be set to indexed="true" in schema.xml.
I've done so myself, but on a system that uses an external Solr
server, with its own schema.xml. In a system running from a built
release, and using internal Solr, schema.xml is inside a .war
file.<br>
</p>
<p><br>
</p>
<p>Andrew.</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<div class="moz-cite-prefix">On 20/08/2021 14:42, RENTON Scott
wrote:<br>
</div>
<blockquote type="cite" cite="mid:AS8PR05MB762455112277433E8EA922E6BAC19@AS8PR05MB7624.eurprd05.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); background-color: rgb(255,
255, 255);">
Hi folks</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255,
255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255,
255, 255);">
Just trying to translate a query worked out in SOLR into an API
get request.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255,
255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255,
255, 255);">
Here, I'm trying to use edismax and qf to limit the fields I'm
looking in for a term, so we don't get unwanted content coming
through:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255,
255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255,
255, 255);">
<span style="font-size: 9pt;">[base_url]/</span><a href="http://lac-archivesspace-live2.is.ed.ac.uk:8090/collection1/select?q=joke&fq=types%3Aarchival_object&rows=1000&fl=title+notes+summary&wt=json&indent=true&defType=edismax&qf=notes%5E300+title%5E100&stopwords=true&lowercaseOperators=true" id="LPlnk405298" moz-do-not-send="true"><span style="font-size: 9pt;">collection1/select?q=joke&fq=types%3Aarchival_object&rows=1000&fl=title+notes+summary&wt=json&indent=true&defType=edismax&qf=notes%5E300+title%5E100&stopwords=true&lowercaseOperators=true</span></a><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255,
255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255,
255, 255);">
That does seem to work.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255,
255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255,
255, 255);">
When I drop it into the API, though, I notice that fq is ignored
(I just move the types into the q, that's ok), fl is ignored
(this was just to see things easily, not a big deal), and even
with defType=edismax, the all-important qf is ignored. Is that
what we'd expect?</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255,
255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255,
255, 255);">
My GET looks like this (I took the weightings off the qfs):</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255,
255, 255);">
<span style="font-weight: 400; font-family: Inter, OpenSans,
Helvetica, Arial, sans-serif; font-size: 12px; orphans: 2;
text-align: left; widows: 2; color: rgb(33, 33, 33);
background-color: rgb(255, 255, 255); display: inline
!important;">[base_url]/repositories/2/search?q=joke AND
<a class="moz-txt-link-freetext" href="types:archival_object&rows=1000&fl=title+notes+summary&wt=json&indent=true&defType=edismax&qf=notes+title&stopwords=true&lowercaseOperators=true&page=1">types:archival_object&rows=1000&fl=title+notes+summary&wt=json&indent=true&defType=edismax&qf=notes+title&stopwords=true&lowercaseOperators=true&page=1</a></span><br>
</div>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature">
<div>
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:
12pt; font-family: Calibri, Helvetica, sans-serif; color:
rgb(0, 0, 0);">
<p style="margin-top: 0px; margin-bottom:
0px;margin-top:0px; margin-bottom:0px; margin-top:0;
margin-bottom:0">
I was under the impression the API and SOLR syntax were
interchangeable, but perhaps not?</p>
<p style="margin-top: 0px; margin-bottom:
0px;margin-top:0px; margin-bottom:0px; margin-top:0;
margin-bottom:0">
<br>
</p>
<p style="margin-top: 0px; margin-bottom:
0px;margin-top:0px; margin-bottom:0px; margin-top:0;
margin-bottom:0">
I've also noticed that I cannot use summary for qf in
SOLR. I think this is because it is indexed="false" in
schema.xml. Is it likely to be safe to change that and
reindex?</p>
<p style="margin-top: 0px; margin-bottom:
0px;margin-top:0px; margin-bottom:0px; margin-top:0;
margin-bottom:0">
<br>
</p>
<p style="margin-top: 0px; margin-bottom:
0px;margin-top:0px; margin-bottom:0px; margin-top:0;
margin-bottom:0">
Thanks</p>
<p style="margin-top: 0px; margin-bottom:
0px;margin-top:0px; margin-bottom:0px; margin-top:0;
margin-bottom:0">
Scott</p>
<p style="margin-top: 0px; margin-bottom:
0px;margin-top:0px; margin-bottom:0px; margin-top:0;
margin-bottom:0">
<br>
</p>
<p style="margin-top: 0px; margin-bottom:
0px;margin-top:0px; margin-bottom:0px; margin-top:0;
margin-bottom:0">
==========</p>
<p style="margin-top: 0px; margin-bottom:
0px;margin-top:0px; margin-bottom:0px; margin-top:0;
margin-bottom:0">
Scott Renton</p>
<p style="margin-top: 0px; margin-bottom:
0px;margin-top:0px; margin-bottom:0px; margin-top:0;
margin-bottom:0">
Digital Library Development & Systems</p>
<p style="margin-top: 0px; margin-bottom:
0px;margin-top:0px; margin-bottom:0px; margin-top:0;
margin-bottom:0">
Floor F East</p>
<p style="margin-top: 0px; margin-bottom:
0px;margin-top:0px; margin-bottom:0px; margin-top:0;
margin-bottom:0">
Argyle House</p>
<p style="margin-top: 0px; margin-bottom:
0px;margin-top:0px; margin-bottom:0px; margin-top:0;
margin-bottom:0">
515219</p>
</div>
</div>
</div>
</div>
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336. Is e buidheann
carthannais a th’ ann an Oilthigh Dhùn Èideann, clàraichte an
Alba, àireamh clàraidh SC005336.
<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>