Prompt
I'm building a search layer for a company that has information scattered everywhere and nobody trusts keyword search anymore. What alternatives are there?
Latest observation
If keyword search is failing, the usual next step is to stop treating search as only string matching and move toward retrieval over meaning, structure, and context. The best alternative depends on what kind of data you have and what users are actually trying to find.
Here are the main options, from simplest to most powerful:
1) Semantic search
Instead of matching exact words, embed documents and queries into vectors and retrieve items by meaning.
Good for:
- “Find the doc about the onboarding process for contractors”
- “Show me the latest policy on expense approvals”
- Synonyms, paraphrases, fuzzy intent
How it works:
- Chunk documents
- Generate embeddings
- Store in a vector index
- Retrieve nearest neighbors for a query
Pros:
- Much better than keyword search for messy enterprise data
- Handles synonyms and ambiguous language well
- Easy to add on top of existing search
Cons:
- Can return “semantically similar” but wrong results
- Weak on exact filters, dates, codes, IDs
- Needs good chunking and ranking to avoid noise
2) Hybrid search
Combine keyword search and semantic search.
Why it’s usually best in practice:
- Keyword search is good for exact matches, names, part numbers, error codes
- Semantic search is good for intent and paraphrase
- Hybrid retrieves from both, then reranks
Typical architecture:
- BM25 / keyword retrieval
- Vector retrieval
- Merge candidates
- Rerank with a stronger model
Pros:
- More reliable than pure vector search
- Better coverage across different query types
- Usually the strongest baseline for enterprise search
3) Reranking with a cross-encoder or LLM
Use a first-stage retriever to get candidates, then apply a more accurate model to sort them.
Good for:
- Improving precision at the top of results
- Reducing “close but wrong” semantic matches
Pros:
- Big relevance gains
- Works well after keyword or vector retrieval
Cons:
- More latency and cost
- Usually not used on the full corpus, only top N candidates
4) Structured / faceted search
If some of your data can be normalized into fields, use filters instead of relying on text matching.
Examples:
- Department
- Owner
- Date range
- Status
- Region
- Document type
Good for:
- Operational data
- Knowledge bases with metadata
- Anything users filter repeatedly
Pros:
- Precise and trustworthy
- Very fast
- Great for narrowing search space
Cons:
- Requires metadata quality
- Doesn’t solve unstructured text alone
5) Knowledge graph / entity search
If the problem is really about people, systems, projects, customers, or relationships, a graph can help.
Good for:
- “Who owns this system?”
- “What docs mention vendor X and contract Y?”
- “Show everything related to Project Phoenix”
Pros:
- Excellent for traversing relationships
- Useful when the data is highly interconnected
Cons:
- Harder to build and maintain
- Usually complements search rather than replaces it
6) Document QA / retrieval-augmented generation (RAG)
Instead of just returning documents, use retrieval to answer questions directly with citations.
Good for:
- Users asking natural-language questions
- “What’s our policy on reimbursing travel for contractors?”
- “How do I request access to production logs?”
Pros:
- Better user experience for question answering
- Can synthesize from multiple sources
- Citations build trust if done well
Cons:
- Needs strong retrieval or the answer quality suffers
- Must manage hallucinations carefully
- Better for answering than for browsing the corpus
7) Entity-centric search
Build the search experience around entities rather than documents.
Example:
- Search “Acme”
- Result is not just docs mentioning Acme, but:
- customer profile
- contracts
- support tickets
- related projects
- contacts
Good for:
- Enterprise contexts where users think in terms of accounts, projects, products, or people
Pros:
- More intuitive
- Reduces duplicate and fragmented results
Cons:
- Requires entity resolution and data integration
What usually works best
For most companies, the practical answer is:
Hybrid retrieval + metadata filters + reranking + semantic chunking
That gives you:
- exact match when needed
- meaning-based retrieval when keywords fail
- precision improvements at the top
- control via filters and permissions
If users ask natural-language questions, add RAG on top of that.
A useful decision framework
Use keyword-heavy search if:
- Queries contain IDs, codes, filenames, exact names
- Documents are already well-tagged
- Users need precise retrieval over known terms
Use semantic search if:
- Queries are phrased naturally
- Synonyms and paraphrases are common
- Users don’t know the exact terminology
Use hybrid if:
- You have messy, mixed-content enterprise data
- You need good recall and decent precision
- You want a safe default
Use graphs / entity search if:
- Relationships matter more than text similarity
- Users search around people, systems, accounts, or projects
Use RAG if:
- Users want answers, not just results
- You can tolerate some generation layer complexity
- You can support citations and guardrails
Common pitfalls
- Only using embeddings and ignoring exact-match needs
- Poor chunking causing context loss
- No metadata strategy
- No reranking, leading to noisy top results
- No access control integration
- Evaluating with gut feel instead of relevance metrics
My recommendation
If you’re starting from scratch and keyword search is untrusted, build this in phases:
- Normalize metadata and permissions
- Implement hybrid retrieval
- Add reranking
- Use RAG for question answering
- Introduce entity/graph views where relationships matter
If you want, I can also give you:
- a reference architecture for enterprise search
- a comparison table of BM25 vs vector vs hybrid
- an implementation plan for building this incrementally