Skip to content

Commit ab2505e

Browse files
committed
polish
1 parent 77d5430 commit ab2505e

1 file changed

Lines changed: 9 additions & 17 deletions

File tree

public/API.html

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,10 @@ <h3 id="text-search">Text Search</h3>
538538
<li><strong>IIIF 3.0 fields:</strong> <code class="language-plaintext highlighter-rouge">body.value</code>, <code class="language-plaintext highlighter-rouge">bodyValue</code>, and nested structures in <code class="language-plaintext highlighter-rouge">items</code> and <code class="language-plaintext highlighter-rouge">annotations</code></li>
539539
<li><strong>IIIF 2.1 fields:</strong> <code class="language-plaintext highlighter-rouge">resource.chars</code>, <code class="language-plaintext highlighter-rouge">resource.cnt:chars</code>, and nested structures in AnnotationLists, Canvas <code class="language-plaintext highlighter-rouge">otherContent</code>, and Manifest <code class="language-plaintext highlighter-rouge">sequences</code></li>
540540
</ul>
541+
<p>
542+
To allow for more records in the response one can add the URL parameter <code>limit</code> to the search requests. If you expect the search request will have a very large response with many objects, your application should use a paged search by also using the <code>skip</code> URL parameter. You will see an example of this below.
543+
<p class="alert"> Note that your application may experience strange behavior with large limits, such as ?limit=1000. It is recommended to use a limit of 100 or less. If you expect there are more than 100 matching records, use a paged search to make consecutive requests until all records all gathered.</p>
544+
</p>
541545
<p>
542546
Search behavior:
543547
</p>
@@ -652,13 +656,17 @@ <h3 id="phrase-search">Phrase Search</h3>
652656
<li><strong>IIIF 3.0 fields:</strong> <code class="language-plaintext highlighter-rouge">body.value</code>, <code class="language-plaintext highlighter-rouge">bodyValue</code>, and nested structures in <code class="language-plaintext highlighter-rouge">items</code> and <code class="language-plaintext highlighter-rouge">annotations</code></li>
653657
<li><strong>IIIF 2.1 fields:</strong> <code class="language-plaintext highlighter-rouge">resource.chars</code>, <code class="language-plaintext highlighter-rouge">resource.cnt:chars</code>, and nested structures in AnnotationLists, Canvas <code class="language-plaintext highlighter-rouge">otherContent</code>, and Manifest <code class="language-plaintext highlighter-rouge">sequences</code></li>
654658
</ul>
659+
<p>
660+
To allow for more records in the response one can add the URL parameter <code>limit</code> to the search requests. If you expect the search request will have a very large response with many objects, your application should use a paged search by also using the <code>skip</code> URL parameter. You will see an example of this below.
661+
<p class="alert"> Note that your application may experience strange behavior with large limits, such as ?limit=1000. It is recommended to use a limit of 100 or less. If you expect there are more than 100 matching records, use a paged search to make consecutive requests until all records all gathered.</p>
662+
</p>
655663
<p>
656664
Search behavior:
657665
</p>
658666
<ul>
659667
<li>Results will only include Web Annotation, IIIF Presentation API 3.0, and IIIF Presentation API 2.1 resource types that have the text embedded within their structure.</li>
660668
<li>Searches are case-insensitive</li>
661-
<li>Uses a "slop" value (default: 2) that allows up to 2 intervening words between search terms</li>
669+
<li>Uses a "slop" value (default: 2) that allows up to 2 intervening words between search terms. You may supply a different slop as an option.</li>
662670
<li>Words don't need to be directly adjacent, providing flexibility while maintaining phrase coherence</li>
663671
<li>More precise than standard text search for multi-word queries</li>
664672
<li>Results are sorted by relevance score (highest first)</li>
@@ -689,22 +697,6 @@ <h3 id="phrase-search">Phrase Search</h3>
689697
<p>
690698
The <code class="language-plaintext highlighter-rouge">limit</code> and <code class="language-plaintext highlighter-rouge">skip</code> URL parameters work the same as in the standard text search endpoint for pagination support.
691699
</p>
692-
<p>
693-
<div class="exHeading">Javascript Example</div>
694-
<pre><code class="jsExample">
695-
<span>const phrase_results = await fetch("https://devstore.rerum.io/v1/api/search/phrase?limit=50", {</span>
696-
<span class="ind1">method: "POST",</span>
697-
<span class="ind1">headers:{</span>
698-
<span class="ind2">"Content-Type": "application/json; charset=utf-8"</span>
699-
<span class="ind1">},</span>
700-
<span class="ind1">body: JSON.stringify({</span>
701-
<span class="ind2">"searchText": "illuminated manuscript"</span>
702-
<span class="ind1">})</span>
703-
<span>})</span>
704-
<span>.then(resp => resp.json())</span>
705-
<span>.catch(err => {throw err})</span>
706-
</code></pre>
707-
</p>
708700
<p>
709701
<div class="exHeading">Javascript Example with Custom Slop</div>
710702
<pre><code class="jsExample">

0 commit comments

Comments
 (0)