Search

Document AI search finds processed content by meaning, exact terms, identifiers, and common spelling variations.

Search returns page-level matches so users can open the most relevant location in a document.

Prerequisite

A document must be processed with embed: true before its content is available to semantic search.

If a document does not appear:

  1. Confirm its latest applicable run completed.
  2. Confirm the selected processing configuration enabled embeddings.
  3. Create a new run with embeddings enabled if needed.

Search in Shipwell

  1. Open Document AI .
  2. Enter a phrase, identifier, party name, or document concept in search.
  3. Apply filters if needed.
  4. Open a result to review the matched page.

Useful searches include:

  • proof of delivery
  • BOL-10482
  • documents mentioning detention
  • A carrier, shipper, or consignee name
  • A sentence describing the information you need

Search through the API

Use one or more q parameters:

curlpython
Copy
Copied
curl --get \
  "https://sandbox-api.shipwell.com/document-store/documents:search" \
  -H "Authorization: Token <user-token>" \
  --data-urlencode "q=proof of delivery for SW-1001" \
  --data-urlencode "page=1" \
  --data-urlencode "page_size=25"
Copy
Copied
import requests

response = requests.get(
    "https://sandbox-api.shipwell.com/document-store/documents:search",
    headers={"Authorization": "Token <user-token>"},
    params={
        "q": "proof of delivery for SW-1001",
        "page": 1,
        "page_size": 25,
    },
    timeout=30,
)
response.raise_for_status()
results = response.json()

The response includes:

  • data — page-level search hits
  • count — total matching hits
  • Pagination links
  • queries — query variants used for the request

A hit includes:

  • document_id and filename
  • page_number
  • A matching content_text snippet
  • relevance
  • Match signals such as exact_score
  • run_id and result_id
  • Document status and type when available
  • Document associations in entities

Use document_id, result_id, and page_number to open or inspect the matching source page.

Filter results

Available filters include:

Parameter Use
document_id Search within one document.
content_type Restrict results to a MIME type.
entity_type Restrict results by association type. Repeat to include multiple values.
entity_id Restrict results by association identifier. Repeat to include multiple values.
status Restrict results by document status. Repeat to include multiple values.
document_type Restrict results by detected document type. Repeat to include multiple values.

For example, use entity_type=shipment and entity_id=SW-1001 to search documents associated with one shipment.

Multiple query variants

Repeat q to submit up to eight alternative descriptions:

Copy
Copied
?q=proof+of+delivery&q=delivery+receipt&q=signed+POD

Variants are useful when your application knows domain-specific alternatives. Put the user's original query first.

Relevance controls

  • rerank defaults to true for higher-precision ordering.
  • Set rerank=false when lower latency is more important than refined ordering.
  • min_relevance controls the relevance floor when reranking is enabled.
  • min_similarity controls the semantic similarity floor.
  • snippet_chars limits the returned text for each hit. Set it to 0 to return scores without snippets.

Start with the defaults. Tune thresholds only after evaluating representative searches; high thresholds can remove useful results.

Pagination

  • page is 1-indexed.
  • page_size defaults to 25 and supports up to 100.
  • Follow next , previous , or the structured links object rather than constructing pagination URLs manually.

Search safety

Search results are evidence, not a final business decision. Before automating a high-impact action:

  1. Retrieve the matching document and page.
  2. Verify the relevant extracted value or source text.
  3. Apply your workflow's validation and authorization rules.
Copyright © Shipwell 2025. All right reserved.