Skip to content

Search Feature with Algolia/Upstash

Document Information

Version: 2.0 Last Updated: 2026-01-15 Status: Active Owner: Product Team


Overview

Purpose

The Search feature enables users to quickly find clients, partners, vehicles, orders, invoices, and users within their company context, dramatically reducing time spent locating information and improving operational efficiency across the platform.

Problem Statement

Users currently spend excessive time navigating through lists and filters to locate specific entities. Manual searches through large datasets lead to:

  1. Lost productivity: Staff spend 15-30 minutes per day searching for information manually
  2. Customer service delays: Support calls extend 2-3 minutes while staff locate customer records
  3. Data isolation gaps: Without proper search boundaries, there’s risk of cross-company data exposure
  4. Scalability limits: As company data grows, current navigation methods become increasingly inefficient

Business Value

Value AreaMeasurable OutcomeBaselineTargetTimeframe
Staff ProductivityTime saved per employee per day searching for records20 minutes/day (manual navigation)3 minutes/day3 months post-launch
Customer Service SpeedAverage time to locate customer record during support calls45 secondsUnder 5 seconds3 months post-launch
Data SecurityCross-tenant data exposure incidents0 (required compliance)0 (maintain compliance)Continuous
Platform ScalabilityMaximum searchable entities without performance degradation50,000 entities1,000,000+ entities6 months post-launch
Infrastructure CostMonthly search infrastructure cost€X (Algolia)40% reductionUpon migration completion

Success Metrics

MetricDefinitionBaselineTargetMeasurement Method
Search Response TimeTime from query submission to results displayedN/A (new feature)<500ms (95th percentile)Application performance monitoring
Search Adoption Rate% of users utilizing search vs. manual navigation0%80%+User analytics (search events / active users)
Time to First ResultEnd-to-end time users spend finding specific records45 seconds avg<10 seconds avgUser session analytics
Support Call EfficiencyAverage call duration for record lookup requests4.5 minutes3 minutesCall center analytics
Data Isolation ComplianceCross-tenant search result incidents00Security audit logs, penetration testing
Index FreshnessTime between database change and searchable availabilityN/A<5 minutesMonitoring dashboard
Search Accuracy% of searches returning relevant results in top 5N/A95%+User feedback, click-through analytics
System AvailabilitySearch service uptimeN/A99.9%Infrastructure monitoring
Migration Success% of searches successfully served by new infrastructure0%100%Feature flag analytics

User Stories

End Users

PriorityUser StoryAcceptance Criteria
P0As a rental manager, I want to search for clients by name, email, or phone so I can quickly access their rental historyGiven I enter a client’s partial name or contact info, When I submit the search, Then matching clients appear within 500ms with relevance ranking
P0As a fleet coordinator, I want to search vehicles by plate number, VIN, or brand/model so I can locate specific vehiclesGiven I search for a partial plate number or VIN, When results display, Then I see matching vehicles with typo tolerance
P0As an operations manager, I want to search orders by order number or customer name so I can track rental statusGiven I enter an order number or customer name, When I search, Then relevant orders display with current status visible
P1As a financial controller, I want to search invoices by number or customer so I can manage billing efficientlyGiven I search for an invoice, When results appear, Then I can identify the correct invoice and access it directly
P1As a support staff member, I want to search across multiple entity types simultaneously so I can help customers efficientlyGiven I enter a general query, When I search, Then I see categorized results across clients, orders, and invoices
P2As a partner manager, I want to search partners by company name or contact info so I can manage partnershipsGiven I search for a partner, When results display, Then I see matching partners with company and contact details

Administrators

PriorityUser StoryAcceptance Criteria
P1As a system administrator, I want search data to stay synchronized automatically so users always find current informationGiven an entity is created or updated, When 5 minutes pass, Then the change is reflected in search results
P2As a platform administrator, I want to search across all companies so I can provide global supportGiven I have platform admin access, When I search companies, Then I see results across all tenants

Functional Requirements

Business Need: Users need to find information quickly across different data types without knowing which category to look in.

Capabilities:

  • Search across clients, partners, vehicles, orders, users, and invoices from a single search box
  • Filter results by entity type when needed
  • Rank results by relevance to surface most likely matches first
  • Support typo tolerance to handle common input errors

Acceptance Criteria:

  • Users can search all entity types or filter to specific types
  • Results display within 500ms for 95% of queries
  • Typo tolerance handles 1-2 character mistakes

FR-2: Company Data Isolation

Business Need: Each company’s data must remain completely isolated to meet privacy requirements and build customer trust.

Capabilities:

  • Search results automatically filtered to user’s company context
  • Cross-company data access prevented at infrastructure level
  • Deleted records excluded from results by default, with option to include

Acceptance Criteria:

  • Users only see results from their own company
  • No configuration or user action required for isolation
  • Security audit confirms zero cross-company data leakage

FR-3: Search Result Handling

Business Need: Search must integrate seamlessly with existing workflows so users can act on results immediately.

Capabilities:

  • Results link directly to entity detail pages
  • Sufficient preview information to identify correct result without clicking
  • Support for bulk operations on search results

Acceptance Criteria:

  • One-click navigation from result to entity
  • Preview shows key identifying information (name, number, status)
  • Results maintain context for back-navigation

FR-4: Automated Data Synchronization

Business Need: Search results must reflect current data to prevent users from acting on outdated information.

Capabilities:

  • Automatic synchronization of new and updated entities
  • Scheduled full synchronization to ensure consistency
  • Self-healing capability when synchronization errors occur

Acceptance Criteria:

  • New entities searchable within 5 minutes of creation
  • Updates reflected within 5 minutes
  • Failed synchronizations retry automatically

FR-5: Platform-Wide Search (Admin Only)

Business Need: Platform administrators need to search across all companies for support and compliance purposes.

Capabilities:

  • Search all companies from admin interface
  • Search marketplace orders separately
  • Maintain audit trail of admin searches

Acceptance Criteria:

  • Admin-only access enforced
  • Results clearly indicate source company
  • All admin searches logged for compliance

FR-6: Migration Support

Business Need: Transition to new search infrastructure must occur without disrupting users or losing data.

Capabilities:

  • Gradual rollout controlled by configuration
  • Instant rollback if issues detected
  • Parallel operation during transition period

Acceptance Criteria:

  • Zero user-facing downtime during migration
  • Feature flags enable per-entity-type migration
  • Rollback completes within 1 minute

Business Rules

BR-1: Tenant Data Isolation

All searches within a company context must return only that company’s data. Cross-company searches are prohibited except for authorized platform administrators.

BR-2: Soft Delete Handling

Deleted records remain searchable only when explicitly requested. Default searches exclude deleted items to prevent confusion.

BR-3: Search Field Scope

Only designated fields are searchable per entity type. Adding new searchable fields requires coordination with data governance.

BR-4: Data Freshness

Search results must reflect database state within 5 minutes. Longer delays require user notification.


Non-Functional Requirements

Performance

  • Search queries: <500ms response (95th percentile)
  • Batch indexing: 10,000+ entities per minute
  • Concurrent users: Support 1,000+ simultaneous searches

Scalability

  • Entity capacity: 1,000,000+ documents per tenant scope
  • Tenant capacity: 1,000+ tenants without degradation

Availability

  • Service uptime: 99.9% availability target
  • Failover: Automatic recovery within 60 seconds

Security

  • Tenant isolation enforced at infrastructure level
  • All search access requires authentication
  • Admin searches audited for compliance

Dependencies

Internal Systems

  • PostgreSQL Database: Source of truth for all searchable entities
  • GraphQL API: Primary interface for search queries
  • Feature Flags: Controls migration rollout
  • Error Monitoring: Captures and alerts on search failures

External Services

  • Upstash Search: Target search infrastructure
  • Algolia: Legacy search (being migrated from)
  • Upstash Workflow: Orchestrates data synchronization jobs

Risks and Mitigations

RiskImpactLikelihoodMitigation
Cross-tenant data exposureCriticalLowInfrastructure-level isolation, security audits, penetration testing
Search unavailabilityHighLow99.9% SLA, automatic failover, monitoring alerts
Data synchronization lagMediumMedium<5 minute sync target, monitoring dashboard, automatic retries
Migration disruptionHighLowFeature flag rollback, parallel systems, gradual rollout

Glossary

TermDefinition
TenantAn isolated company/organization within the platform
Tenant IsolationSecurity ensuring one company cannot access another’s data
EntityA searchable business object (client, order, vehicle, etc.)
Relevance RankingSorting results by likelihood of matching user intent
Typo ToleranceReturning results despite minor spelling errors
Soft DeleteMarking records as deleted without removing from storage

Change Log

DateVersionChangesAuthor
2026-01-091.0Initial PRD createdProduct Team
2026-01-152.0Converted to business-focused format: added measurable outcomes, success metrics table, consolidated functional requirements, prioritized user stories, removed technical implementation detailsProduct Team