Skip to content

Search Use Cases (SRC)

Module Purpose: Enable document discovery through full-text, filtered, and semantic search. This module contains 6 use cases.


Use Case Quick Reference

ID Title Priority
SRC-001 Full-Text Search P1
SRC-002 Filter by Tags P1
SRC-003 Filter by Classification P1
SRC-004 Filter by Date Range P2
SRC-005 Semantic Search P2
SRC-006 Export Search Results P2

Overview

Field Value
ID SRC-001
Title Full-Text Search
Actor User
Priority P1 (MVP Phase 3)

Description

Search documents by keyword using full-text search index.

Features

Feature Description
Keywords Match exact words
Phrases Match exact phrases with quotes
Wildcards Prefix matching with *
Boolean AND, OR, NOT operators

Steps

  1. Parse search query
  2. Query Meilisearch index
  3. Apply relevance ranking
  4. Return paginated results

Input

{
  "query": "invoice payment 2024",
  "page": 1,
  "limit": 20
}

Output

{
  "total": 156,
  "page": 1,
  "results": [
    {
      "id": "doc_abc",
      "title": "Invoice #12345",
      "snippet": "...payment of $5,000 due by January 2024...",
      "score": 0.95,
      "type": "invoice",
      "created_at": "2024-01-10"
    }
  ]
}

Acceptance Criteria

  • Keyword search returns relevant results
  • Phrase search supported
  • Results ranked by relevance
  • Response time <200ms

UC-SRC-002: Filter by Tags

Overview

Field Value
ID SRC-002
Title Filter by Tags
Actor User
Priority P1 (MVP Phase 3)

Description

Filter search results by one or more tags.

Input

{
  "query": "payment",
  "filters": {
    "tags": ["org:Acme Corp", "category:finance"]
  }
}

Query Operators

Operator Example Meaning
AND tags:a AND tags:b Must have both
OR tags:a OR tags:b Must have either
NOT NOT tags:a Must not have

Acceptance Criteria

  • Single tag filter works
  • Multiple tags with AND/OR
  • Tag negation supported

UC-SRC-003: Filter by Classification

Overview

Field Value
ID SRC-003
Title Filter by Classification
Actor User
Priority P1 (MVP Phase 3)

Description

Filter search results by document type and category.

Input

{
  "query": "*",
  "filters": {
    "type": "invoice",
    "category": "finance"
  }
}

Acceptance Criteria

  • Filter by document type
  • Filter by category
  • Combined filters work

UC-SRC-004: Filter by Date Range

Overview

Field Value
ID SRC-004
Title Filter by Date Range
Actor User
Priority P2

Description

Filter search results by creation or upload date.

Input

{
  "query": "invoice",
  "filters": {
    "date_from": "2024-01-01",
    "date_to": "2024-03-31"
  }
}

Date Fields

Field Description
created_at Document creation date
uploaded_at Upload timestamp
processed_at Processing completion time

Acceptance Criteria

  • Date range filter works
  • Multiple date fields supported
  • Relative dates (last 7 days, etc.)

Overview

Field Value
ID SRC-005
Title Semantic Search
Actor User
Priority P2 (MVP Phase 3)

Description

Search by meaning using vector similarity, not just keywords.

Steps

  1. Embed search query using same model as documents
  2. Query Qdrant for similar embeddings
  3. Re-rank with recency and other factors
  4. Return results with similarity scores

Input

{
  "query": "documents about contract renewal terms",
  "mode": "semantic",
  "limit": 10
}

Output

{
  "results": [
    {
      "id": "doc_xyz",
      "title": "Master Service Agreement",
      "similarity": 0.89,
      "snippet": "...automatic renewal unless terminated..."
    }
  ]
}

Acceptance Criteria

  • Semantic similarity search works
  • Results are conceptually relevant
  • Hybrid search (keyword + semantic) available

UC-SRC-006: Export Search Results

Overview

Field Value
ID SRC-006
Title Export Search Results
Actor User
Priority P2

Description

Export search results to CSV or JSON for offline analysis.

Export Formats

Format Contents
CSV ID, Title, Type, Tags, Date
JSON Full document metadata

Steps

  1. Execute search query
  2. Retrieve all matching documents (up to limit)
  3. Format as requested
  4. Return download link

Acceptance Criteria

  • CSV export works
  • JSON export works
  • Large result sets handled (pagination)

← Back to Use Cases | Previous: OCR Processing | Next: API →