<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 id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi Steelsen, </p>
<p><br>
</p>
<p>Yes, so for advanced queries, you pass in a jsonmodel advanced_query object ( <a id="LPlnk840737" href="https://github.com/archivesspace/archivesspace/blob/master/common/schemas/advanced_query.rb">
https://github.com/archivesspace/archivesspace/blob/master/common/schemas/advanced_query.rb</a> )</p>
<p><br>
</p>
<p> This  object has a property "query" that can be a boolean_query ( <a id="LPlnk995531" href="https://github.com/archivesspace/archivesspace/blob/master/common/schemas/boolean_query.rb">
https://github.com/archivesspace/archivesspace/blob/master/common/schemas/boolean_query.rb)</a> boolean_field_query (
<a id="LPlnk355672" href="https://github.com/archivesspace/archivesspace/blob/master/common/schemas/boolean_field_query.rb">
https://github.com/archivesspace/archivesspace/blob/master/common/schemas/boolean_field_query.rb</a> ) date_field_query (
<a id="LPlnk391768" href="https://github.com/archivesspace/archivesspace/blob/master/common/schemas/date_field_query.rb">
https://github.com/archivesspace/archivesspace/blob/master/common/schemas/date_field_query.rb</a> ) or a field_query (
<a id="LPlnk972003" href="https://github.com/archivesspace/archivesspace/blob/master/common/schemas/field_query.rb">
https://github.com/archivesspace/archivesspace/blob/master/common/schemas/field_query.rb</a> )
</p>
<p><br>
</p>
<p><br>
</p>
<p>So, a queries could look like this:</p>
<p><br>
</p>
<p>boolean query ( keyword 'My Awesome Search Term' and 'AND'  published = true ) :</p>
<p> "http://localhost:4567/repositories/2/search?page=1&aq={\"query\":{\"op\":\"AND\",\"subqueries\":[{\"field\":\"keyword\",\"value\":\"My Awesome Search Term\",\"jsonmodel_type\":\"field_query\",\"negated\":false,\"literal\":false},{\"field\":\"published\",\"value\":true,\"jsonmodel_type\":\"boolean_field_query\"}],\"jsonmodel_type\":\"boolean_query\"},\"jsonmodel_type\":\"advanced_query\"}"<br>
</p>
<p><br>
</p>
<p>boolean_field_query ( published = true ):</p>
<p>"http://localhost:4567/repositories/2/search?page=1&aq={\"query\":{\"field\":\"published\",\"value\":true,\"jsonmodel_type\":\"boolean_field_query\"},\"jsonmodel_type\":\"advanced_query\"}"<br>
</p>
<p><br>
</p>
<p>field query ( keyword for 'My Awesome Search Term') : <br>
</p>
<p>"http://localhost:4567/repositories/2/search?page=1&aq={\"query\":{\"field\":\"keyword\",\"value\":\"My Awesome Search Term\",\"jsonmodel_type\":\"field_query\",\"negated\":false,\"literal\":false}}<br>
</p>
<p><br>
</p>
<p>date_field_query  (  Created date after May 5 2015 ) :</p>
<p> "http://localhost:4567/repositories/2/search?page=1&aq={\"query\":{\"field\":\"create_time\",\"value\":\"2015-05-05\",\"comparator\":\"greater_than\",\"jsonmodel_type\":\"date_field_query\"},\"jsonmodel_type\":\"advanced_query\"}"</p>
<p><br>
</p>
<p> <span id="ms-rterangepaste-end">Does</span> that help? </p>
<p><br>
</p>
<p>b,chris. <br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<div id="Signature">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div class="BodyFragment"><font size="2">
<div class="PlainText">Chris Fitzpatrick | <font size="2">Developer, ArchivesSpace</font><br>
Skype: chrisfitzpat  | Phone: 918.236.6048<br>
http://archivesspace.org/<br>
</div>
</font></div>
</div>
</div>
<div style="color: rgb(0, 0, 0);">
<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 Smith, Steelsen
 <steelsen.smith@yale.edu><br>
<b>Sent:</b> Sunday, May 17, 2015 2:41 AM<br>
<b>To:</b> Archivesspace Users Group<br>
<b>Subject:</b> [Archivesspace_Users_Group] Advanced Search for API</font>
<div> </div>
</div>
<div>
<div style="" class="WordSection1">
<p style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: "Calibri",sans-serif;" class="MsoNormal">
Hi All,</p>
<p style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: "Calibri",sans-serif;" class="MsoNormal">
 </p>
<p style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: "Calibri",sans-serif;" class="MsoNormal">
The Rest API Endpoint repositories/:id/search indicates that there’s an advanced search input that requires a json formatted “advanced search” in the URI. Does anyone have an example of what it might look like, or a field list of what can be searched for? I’m
 trying to perform some very specific searches and am finding myself pulling in a lot of extra information and working through it. A more general question, is there better API documentation somewhere than exists in the autodocs? Sample strings would save a
 lot of time from the trial and error process I’m using now.</p>
<p style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: "Calibri",sans-serif;" class="MsoNormal">
 </p>
<p style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: "Calibri",sans-serif;" class="MsoNormal">
Thanks,</p>
<p style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: "Calibri",sans-serif;" class="MsoNormal">
Steelsen</p>
<p style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: "Calibri",sans-serif;" class="MsoNormal">
 </p>
<p style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: "Calibri",sans-serif;" class="MsoNormal">
 </p>
<p style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: "Calibri",sans-serif;" class="MsoNormal">
 </p>
<p class="MsoNormal" style="text-align: right; margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: "Calibri",sans-serif;" align="right">
___________________________<br>
Steelsen Smith<br>
Fulfillment Systems Specialist</p>
<p class="MsoNormal" style="text-align: right; margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: "Calibri",sans-serif;" align="right">
Enterprise Systems Group</p>
<p class="MsoNormal" style="text-align: right; margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: "Calibri",sans-serif;" align="right">
Yale Library IT<br>
203.432.3333</p>
<p style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: "Calibri",sans-serif;" class="MsoNormal">
 </p>
</div>
</div>
</div>
</div>
</body>
</html>