What is Lexical Search?
Ceramic uses lexical (keyword-based) search, which matches documents based on the exact words and phrases in your query. Unlike semantic search systems, Ceramic does not infer meaning, intent, or synonyms—it focuses on precise term matching for speed, transparency, and control.Key characteristics
- Matches exact keywords and phrases
- Fast and computationally efficient
- Does not automatically handle synonyms or intent
Why Keyword Search Works Well with LLMs
While Ceramic uses keyword-based (lexical) search, this approach works especially well when combined with LLMs.LLMs are good at query generation
LLMs can transform natural language into high-quality keyword queries. Instead of relying on the search system to interpret intent, you can use an LLM to:- Rewrite queries into precise keyword-based searches
- Expand queries with synonyms or related terms
- Generate multiple variations of a query
Search becomes a plentiful resource
Many search systems treat search as a scarce and expensive operation, encouraging a single, highly optimized query. Ceramic takes a different approach. With a Search API at very low cost, we found more value in creating several keyword-based searches rather than one overemphasized query. This enables new patterns:- Multi-query retrieval (increase recall)
- Query variation (capture different terminology)
- Iterative refinement (improve results over time)
Example: single query vs multi-query
Instead of one over-optimized query:impact of climate change on agriculture in developing countries
You can issue multiple simpler queries:
climate change agriculture impact
global warming crop yields
developing countries farming climate effects
Why this works
- Lexical search provides fast, precise matching
- LLMs provide understanding and query generation
- Combining both gives you control + flexibility
Recommended approach
For LLM-powered applications:- Start with a user query
- Use an LLM to generate multiple keyword-based queries
- Send each query to Ceramic
- Aggregate and rank the results
What Works Well
Lexical search performs best when your query includes specific, well-defined terms that are likely to appear in the target documents.Good Query Patterns
- Exact names
- Technical terms
- Product names or identifiers
- Specific phrases
| Use case | Example query |
|---|---|
Person lookup | Serena Williams Grand Slam titles |
Technical documentation | OAuth 2.0 |
Legal text | California tenant security deposit return law |
News/event lookup | 2026 Super bowl halftime performer |
What Doesn’t Work Well
Because Ceramic does not perform semantic understanding, it may struggle with:1. Synonyms
Different words with the same meaning are not automatically matched- BBQ ≠ barbecue
- gym ≠ fitness center
gym membership cost may miss results that use fitness center pricing.
2. Vague or abstract queries
Queries without clear keywords may return weak or irrelevant results.| Query | Issue |
|---|---|
technology trends | Too broad |
how people feel about AI | Lacks concrete terms |
3. Natural language / conversational queries
Ceramic does not interpret intent like an LLM or semantic search system.| Query | Issue |
|---|---|
What are the best ways to invest money right now? | Too conversational |
Why is rent so high in California? | Requires reasoning, not keyword matching |
4. Misspellings or loosely related terms
Lexical search relies on exact matching, so spelling and wording matter.How to Write Effective Queries
Specific queries return better results than broad ones. Include relevant context and details.Be specific
Include important keywords, entities, and context| Instead of | Try |
|---|---|
technology news | OpenAI GPT-5 announcement 2025 |
California laws | California tenant security deposit return laws |
Include multiple relevant terms
More context = better matching| Instead of | Try |
|---|---|
climate | climate change policy United States 2024 |
Use explicit synonyms when needed
If you’re unsure which term appears in documents, include multiple:college university tuition costs US
Word order matters
The order of words in your query affects results. The same words in different orders can return different results.| Query | Finds |
|---|---|
cat house | Outdoor shelters for cats |
house cat | Domestic cats as pets |
Using Ceramic with LLMs (Query Rewriting)
If you’re using Ceramic in an AI or RAG pipeline, you should rewrite user queries into keyword-focused search queries before sending them to the API. LLMs are great at this transformation.Example
User query (natural language):Why is rent so high in California right now?
Rewritten query (Ceramic-optimized):
California rent increase causes housing shortage 2025
Prompt Template
Use the following prompt to convert user input into effective Ceramic queries:Example Transformations
| User Query | Rewritten Query |
|---|---|
What are the effects of climate change? | climate change effects global warming impact |
Who performed at the Super Bowl this year? | 2026 Super Bowl halftime performer |
How do I start investing? | beginner investing strategies stocks bonds basics |
Why this matters
Ceramic does not interpret intent like an LLM. Rewriting queries helps:- Improve keyword matching
- Produce more consistent and predictable results
When NOT to Use Ceramic Alone
You may want to combine Ceramic with other systems if your use case requires:- Understanding intent or meaning
- Handling natural language questions
- Matching concepts rather than exact words

