A search box can look like a small feature while becoming one of the most consequential architectural decisions in a business application. Employees expect to find an invoice by number, a customer despite a misspelled name, or an order using several filters. Behind those seemingly simple requests are different requirements for data modeling, indexing, permissions, relevance and operational reliability.
The decision is not simply “SQL versus Elasticsearch.” The useful question is: what searches must users complete, how fresh must results be, and what complexity is the business prepared to operate?
Start with the jobs users need to complete
A finance user locating an invoice by exact ID has a different need from a support agent searching across ticket descriptions. A procurement manager filtering orders by supplier, date and status needs structured predicates. A marketplace user searching “wireless noise cancelling headset” may expect relevance ranking, spelling tolerance and synonyms.
Before selecting technology, document representative queries, expected result counts, filtering behavior, sorting, authorization requirements and acceptable response times. Distinguish known-item lookup, structured exploration, text discovery and cross-entity discovery. Record the consequences of missing a result versus returning an irrelevant result. For a compliance investigation, recall and auditability may matter more than a polished ranking algorithm.

A practical requirements inventory should capture:
- Searchable entities and fields, including nested relationships and attachments.
- Exact matching, prefix matching, phrase matching, typo tolerance and synonyms.
- Filters, facets, sort orders and pagination.
- Access control by user, role, tenant and record.
- Data volume, update rate, peak query concurrency and retention.
- Freshness requirements for new, changed and deleted records.
- Localization, languages and any stemming or transliteration needs.
- Availability objectives, operating budget and team expertise.
Option 1: Database queries and indexes
For many internal applications, the existing relational database is the best starting point. Equality comparisons, indexed joins, range predicates and carefully designed composite indexes handle customer lookups, transaction history and administrative filters efficiently. A query such as customer_id = 1042 AND status = ‘open’ is fundamentally different from searching a paragraph for a concept.
Advantages include a single authoritative data store, immediate transactional consistency for committed changes, straightforward permission checks and fewer infrastructure components. The application can reuse existing backup, audit and monitoring processes.
Limitations appear when developers use unrestricted LIKE ‘%term%’ scans over large text columns, add too many indexes to heavily written tables or assemble expensive joins for every keystroke. Prefix indexes and selective predicates may help, but execution plans and representative production-scale data should guide decisions. An index that improves one query can increase write cost and storage.
Choose database search when the dominant workload is exact lookup, predictable filtering and moderate query complexity. Resist adding a separate engine merely because the interface includes a search box.
Option 2: Full-text search inside the database
Modern relational databases can offer native text-search capabilities. PostgreSQL, for example, supports text-search vectors, queries and indexes; other databases provide their own full-text features with different semantics and limitations. This layer can support tokenization, linguistic processing and relevance ordering without operating a separate search cluster.
Database full-text search often makes sense when users search descriptions, notes or document metadata but the corpus remains manageable and security joins must stay close to transactional records. It also works well when a small team needs more than substring matching but cannot justify another production system.
Test actual relevance. Does searching “invoice approval” find “approved invoices”? Does a phrase search behave as users expect? Are punctuation, product codes, acronyms and names tokenized correctly? Language configuration and ranking weights can change results substantially. Full-text search is not automatically fuzzy search, and typo tolerance should never be assumed.

The main trade-off is resource competition. Heavy text queries and indexing can consume CPU, memory and I/O on the same database that serves transactional workflows. Measure the effect on writes and critical business queries, not only the search endpoint.
Option 3: A dedicated search engine
Dedicated engines such as Elasticsearch, OpenSearch, Solr or hosted search services provide specialized indexing and retrieval capabilities. Depending on product and configuration, these may include advanced analyzers, typo tolerance, synonyms, faceting, highlighting, custom ranking and distributed indexing. Their feature sets and operating models differ, so compare a shortlist against your requirements rather than assuming they are interchangeable.
A separate engine becomes attractive when search is central to the product, relevance tuning is substantial, documents are large or heterogeneous, traffic is high, or queries span multiple entities in ways that strain the transactional database.
The additional system is not free. Data must be copied or transformed into a search index, updates can arrive late, schemas must evolve, and permissions must be enforced correctly. The team inherits index migrations, backfills, capacity planning, incident response and vendor or infrastructure costs. A search cluster is a derived read model, not a replacement for the system of record.
If your application needs sophisticated search, plan it as part of custom web application development rather than as an isolated widget.

A decision framework executives can use
Use these guidelines as starting hypotheses, not universal thresholds:
- Exact identifiers and structured filters dominate: begin with indexed database queries.
- Moderate free-text search within a relational workflow: benchmark native database full-text search.
- Complex relevance, faceting, linguistic features or substantial search traffic: evaluate dedicated engines.
- Mixed workloads: retain exact, permission-sensitive lookups in the database while using a dedicated index for discovery.
- Unclear requirements: build a small benchmark against realistic data before buying or deploying another platform.
Compare candidates on five dimensions: user relevance, latency under realistic load, freshness, security correctness and total cost of ownership. A faster engine that returns unauthorized or stale results is not a successful architecture.
Relevance is a product requirement, not a technical afterthought
A result set can be technically correct and still frustrating. Build a test set of representative queries with expected results, including misspellings, abbreviations, multiword phrases, product codes, customer names and rare terms. Ask business users to judge whether the first few results help them complete the task.
Ranking can combine text relevance with structured signals such as recency, status or business priority, but these boosts need explicit rules. A closed ticket should not outrank an active one solely because it repeats a keyword more often. Avoid hidden ranking changes that make operational searches unpredictable.
Useful evaluation measures include zero-result rate, reformulation rate, click-through to a useful record, time to successful task completion and a human-reviewed relevance score. Track these by query class, not just as one global average.
Security: filter before showing results
Search must respect the same access controls as the application. Multi-tenant applications require tenant isolation for indexed documents, facets, autocomplete suggestions, counts and cached results. It is insufficient to filter only the final page after retrieving a broad set of unauthorized records: counts, snippets or timing may still expose information.
Choose an enforcement pattern appropriate to the platform: separate indexes for strongly isolated tenants, mandatory tenant predicates, document-level authorization filters or a secured application-side retrieval layer. Each has scaling and operational trade-offs. Test cross-tenant access with deliberately adversarial cases.
When permissions change, indexed access-control attributes must change promptly or the application must verify authorization against the authoritative store before disclosing sensitive results. Never assume a stale search index has current permissions.

Index freshness and failure recovery
A dedicated search index is usually eventually consistent with the primary database. Define what “fresh enough” means for each entity. A new knowledge article might tolerate a short delay; a revoked access grant or deleted sensitive record may not.
A robust synchronization design generally includes a durable change feed or outbox, idempotent index updates, stable document IDs, retryable workers and reconciliation. Design for out-of-order events: a delayed update must not resurrect a deleted document. Version numbers or source timestamps, used carefully, can prevent older changes from overwriting newer state.
Plan full rebuilds before they are needed. Use versioned indexes and controlled alias switching where supported, validate document counts and sampled records, and retain a rollback path. During an outage, decide whether the application will degrade to exact database lookup, show a clearly labeled temporary limitation or block a search-dependent workflow. The correct fallback depends on the business risk.
Facets, pagination and performance traps
Faceted search can be useful for status, region, category or date. But facets must honor authorization and active filters. Their counts should match what the user is allowed to see. High-cardinality fields and deeply nested aggregations can become expensive.
For large result sets, avoid relying indefinitely on offset pagination. Deep offsets may require the engine to process many skipped records. Cursor-based pagination or search-after approaches can be more predictable, though they need stable ordering and careful handling of changing data.
Autocomplete is another independent workload. It can multiply query volume because a user generates several requests while typing. Debounce client requests, cap suggestions, protect endpoints from abuse and benchmark peak concurrency.
A practical proof of concept
Week 1
Inventory the top 20 search journeys. Capture sample queries, permissions, expected outcomes, latency goals and data sizes. Classify each journey as exact, structured or relevance-oriented.
Week 2
Build two candidate implementations using a representative, sanitized dataset. Include real distributions of text length, tenant sizes and filters. Measure p50 and p95 latency, indexing cost and transactional database impact.
Week 3
Run user relevance testing and failure scenarios. Simulate a stale index, duplicate update, permission revocation, bulk import and search service outage. Confirm that no unauthorized record or facet count leaks.
Week 4
Compare total ownership cost, operational responsibilities and migration risk. Select the simplest design that meets the acceptance criteria. Document the decision and the conditions that would trigger reevaluation.
This approach fits naturally into a broader custom solutions discovery and architecture process, where search is evaluated alongside application workflows, integrations and database design.

What to monitor after launch
Monitor more than average search latency. A useful operational dashboard includes p95 response time by query type, search error rate, zero-result and reformulation rates, indexing lag, failed updates, index size, CPU and memory pressure, and relevance regression results. Segment by tenant size or user role where permitted.
Define owners for search quality and platform reliability. Product teams should own expected behavior and relevance acceptance; engineering should own indexing, deployment and incident response; security should own authorization requirements. Review changes to analyzers, synonyms and ranking as product releases because they can change business outcomes even when the API remains healthy.
Common mistakes to avoid
The most expensive mistakes are adopting a separate engine before validating requirements, treating a derived index as the authoritative database, ignoring permission changes, benchmarking only tiny datasets, overlooking write amplification and failing to design a rebuild path. Another is assuming “AI search” is a universal upgrade. Semantic or vector retrieval may help with conceptual discovery, but it introduces evaluation, cost and access-control considerations and does not replace exact identifier search.
Frequently asked questions
1. Is SQL search enough for a business application?
Often yes for indexed exact matches, ranges and structured filters. Benchmark real queries before introducing another service.
2. Does full-text search automatically correct typos?
No. Tokenization, stemming and fuzzy matching are distinct capabilities. Check the specific database or engine configuration.
3. When should we introduce Elasticsearch or OpenSearch?
When documented relevance, scale, faceting or linguistic requirements exceed a simpler solution and justify the added operational burden.
4. Should the search index become the source of truth?
Usually not. Keep authoritative transactions and permissions in the primary system and treat the index as a rebuildable read model.
5. How quickly should search reflect updates?
Set freshness targets by business workflow. Sensitive deletes and permission revocations need especially careful handling.
6. Can one application use both SQL and a search engine?
Yes. Exact lookups and transactional filters can stay in SQL while discovery uses a specialized index.
7. How do we secure search in multi-tenant SaaS?
Enforce tenant and record authorization across results, suggestions, facets and caches, and test revocation and cross-tenant scenarios.
8. What is the most useful search performance metric?
Use task success and relevance alongside p95 latency. Speed alone does not establish usefulness.
9. How do we migrate without disrupting users?
Run the new index in parallel, compare results, verify permissions, rebuild and reconcile, then gradually switch traffic with rollback controls.
10. How should we estimate search costs?
Include engineering, indexing resources, query traffic, storage, monitoring, vendor fees, security testing and ongoing relevance tuning.
The bottom line
The right application search architecture is the least complex option that reliably delivers the searches users need. Start with business journeys and realistic tests. Keep permissions and data freshness explicit. Add specialized infrastructure only when measurable requirements justify it.
If you are planning a custom business application or reviewing an underperforming search experience, Actiknow can help assess the application requirements and development approach. Explore our custom application services to start a focused discussion about architecture, delivery and ongoing support.

