SearchSearch Methods
Run Sparse Search
Find candidates with exact keyword matches and technical terms.
Sparse search uses BM25 algorithm to find exact keyword matches in CVs, making it ideal for technical skill searches and specific terminology.
When to Use Sparse Search
✅ Good for:
- Exact keyword matching: "Python, FastAPI, PostgreSQL, Docker"
- Technical skills and certifications: "AWS Solutions Architect", "PMP certified"
- Specific tools and technologies: "Jira, Confluence, Kubernetes"
- Company names: "worked at Google or Meta"
- Acronyms and abbreviations: "CI/CD", "REST API", "ML/AI"
❌ Not ideal for:
- Natural language queries (use Dense Search instead)
- Conceptual matching: "someone who can lead teams"
- Queries with typos or synonyms
How It Works
- Tokenization - Breaks query into keywords and calculates term importance
- BM25 Matching - Finds CVs containing those exact terms using sparse vectors
- Ranked Results - Returns top matches ordered by keyword relevance score
Processing time: 5 to 10 seconds
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Keyword search query (1 to 500 characters). Use comma-separated terms. |
top_k | integer | No | Number of results to return (1 to 100, default: 20) |
searchGroupId | string (UUID) | No | Group this search with others for comparison |
Response Flow
This endpoint returns immediately with a searchId. The actual search runs asynchronously in the background.
Next steps:
- Save the returned
searchId - Poll
GET /v1/public/searches/:searchIdevery 2 to 3 seconds - When
statusis"completed", fetch results fromGET /v1/public/searches/:searchId/results
Rate limit
For rate limit, please check the rate limit in the dedicated API documentation section.
Example Request
POST /v1/public/searches/sparse
{
"query": "Python, FastAPI, PostgreSQL, Docker, Kubernetes, AWS",
"top_k": 20
}Example Response
202 Accepted
{
"searchId": "550e8400-e29b-41d4-a716-446655440000",
"searchGroupId": "660e8400-e29b-41d4-a716-446655440000",
"status": "processing",
"searchType": "sparse",
"query": "Python, FastAPI, PostgreSQL, Docker, Kubernetes, AWS",
"estimatedTime": "5 to 10 seconds",
"statusUrl": "/v1/public/searches/550e8400-e29b-41d4-a716-446655440000",
"resultsUrl": "/v1/public/searches/550e8400-e29b-41d4-a716-446655440000/results"
}Tips for Better Results
- Use comma-separated keywords: "React, TypeScript, Node.js" works better than "React TypeScript Node.js"
- Include exact terms: Spell out acronyms when relevant ("Continuous Integration" vs "CI")
- List required and nice-to-have skills: Put must-haves first
- Use specific names: "Stanford University" instead of "top university"
Sparse vs Dense Comparison
| Feature | Sparse Search | Dense Search |
|---|---|---|
| Algorithm | BM25 keyword matching | Semantic embeddings |
| Best for | Exact terms, technical skills | Concepts, natural language |
| Query style | Keywords, comma-separated | Full sentences, descriptions |
| Handles typos | No | Yes |
| Handles synonyms | No | Yes |
| Speed | Fast (5-10 seconds) | Fast (5-10 seconds) |
Example comparison:
Good for Sparse:
- "Python, FastAPI, PostgreSQL, Docker"
- "AWS certified solutions architect"
- "Stanford University Computer Science"
Better for Dense:
- "someone who can build scalable backend systems"
- "team player with leadership potential"
- "creative problem solver"
Error Responses
| Status | Reason | Solution |
|---|---|---|
| 400 | Invalid query format | Check query length (1 to 500 chars) and top_k range (1 to 100) |
| 401 | Invalid API key | Verify your API key in request headers |
| 500 | Search initiation failed | Retry request or contact support with searchId |
Result Expiration
- Search results are stored in the database and can be retrieved anytime using the same searchId
Comparing Algorithms
Use searchGroupId to run the same query with different algorithms and compare results:
# Run sparse search
POST /v1/public/searches/sparse
{ "query": "Python, Docker, AWS", "searchGroupId": "abc-123" }
# Run dense search with same groupId
POST /v1/public/searches/dense
{ "query": "Python, Docker, AWS", "searchGroupId": "abc-123" }
# Compare results
GET /v1/public/searches/groups/abc-123/resultsX-API-Key<token>
API key for public API access. Get yours at https://app.floreal.ai?tab=api
In: header
querystring
Length
1 <= length <= 500searchGroupId?string | null
top_k?integer | null
Range
1 <= value <= 100Response Body
curl -X POST "https://api.floreal.ai/v1/public/searches/sparse" \
-H "Content-Type: application/json" \
-d '{
"query": "string"
}'{
"searchId": "550e8400-e29b-41d4-a716-446655440000",
"searchGroupId": "660e8400-e29b-41d4-a716-446655440000",
"status": "processing",
"searchType": "sparse",
"query": "Python, FastAPI, PostgreSQL, Docker, Kubernetes",
"estimatedTime": "5 to 10 seconds",
"statusUrl": "/v1/public/searches/550e8400-e29b-41d4-a716-446655440000",
"resultsUrl": "/v1/public/searches/550e8400-e29b-41d4-a716-446655440000/results"
}{
"error": "string",
"message": "string"
}{
"error": "string"
}{
"error": "string",
"message": "string"
}