Skip to content

Advanced Search

Papra supports advanced search queries with filters, logical operators, and grouping to help you find documents efficiently.

A simple search query like foobar will search across both document names and content:

# Search documents where name or content contains
foobar
# This is equivalent to
name:foobar OR content:foobar

Full text search can be combined with filters for more precise results.

# Search documents with tag invoice and containing foobar
tag:invoices foobar

Use filters to search specific document properties. Current supported filters:

  • name: - Search in document names
  • content: - Search in document content
  • tag: - Search by tag name or ID
  • created: - Filter by document creation date
  • has:tags - Check if documents have any tags, it can be negated with -has:tags or NOT has:tags to find untagged documents
# Finds documents whose name contains "invoice"
name:invoice
# Finds documents with "financial report" in their content
# use quotes for phrases with spaces
content:"financial report"
# Finds documents tagged with "urgent"
tag:urgent
# Finds documents created after January 1st, 2024
created:>2024
# Finds documents that have at least one tag
has:tags
# Finds documents without any tags
-has:tags

The has: filter checks whether documents have certain properties:

  • has:tags - Documents with at least one tag
  • -has:tags or NOT has:tags - Documents without any tags
# Find all untagged documents
-has:tags
# Find tagged invoices
has:tags invoice
# Find untagged documents from 2024
-has:tags created:>=2024
# Find tagged documents that are not archived
has:tags NOT tag:archived

The created: filter supports date comparisons with the following operators:

  • = - Exact date match
  • > - After the date
  • >= - On or after the date
  • < - Before the date
  • <= - On or before the date

Dates can be specified in various formats, including:

  • Only year: YYYY (interpreted as January 1st of that year)
  • Month and year: YYYY-MM (interpreted as the first day of that month)
  • Common formats: YYYY/MM/DD, YYYY.MM.DD, Month DD, YYYY, etc.
  • ISO 8601: YYYY-MM-DD, YYYY-MM-DDTHH:MM:SSZ, etc.

Invalid date formats will be ignored in the search query.

# Finds documents created exactly on January 15th, 2024 at 00:00:00
created:2024-01-15
# Finds documents created after January 1st, 2024
created:>2024
# Finds documents created on or after January 1st, 2024
created:>=2024-01-01
# Finds documents created before December 31st, 2024
created:<2024-12-31
# Finds documents created on or before June 30th, 2024
created:<=2024-06-30
# Finds invoices created only in 2024
tag:invoice created:>2024 created:<2025

Combine filters using logical operators (case-insensitive):

  • AND - Both conditions must match
  • OR - Either condition must match
  • NOT (or -) - Negates the condition
name:invoice AND tag:paid

Finds invoices that are tagged as paid

content:contract OR content:agreement

Finds documents containing “contract” or “agreement”

tag:important NOT tag:archived

Finds important documents that are not archived

Negate filters using either - prefix or NOT operator:

# Both equivalent
-tag:archived
NOT tag:archived

Both find documents that are not tagged with “archived”

Use parentheses (...) to group expressions and control precedence:

(name:invoice OR name:receipt) AND tag:2024

Finds documents from 2024 that are either invoices or receipts

tag:important AND (tag:client-a OR tag:client-b)

Finds important documents for client-a or client-b

Use double quotes to search for phrases with spaces:

content:"quarterly financial report"
name:"Budget 2024"

The search functionality is built using:

  • Custom parser in the @papra/search-parser package
  • SQLite FTS5 (Full-Text Search) for efficient text matching
  • Support for additional filters coming in future updates