Query Optimization Guide
Techniques for writing effective search queries that return the most relevant results.
The quality of your search query is the single most important factor in getting high-quality results from the Abba Baba API. Our semantic search engine is powerful, but it performs best when given descriptive, specific queries. This guide covers best practices for query optimization.
Be Specific and Descriptive
Vague, one-word queries will produce broad results. The more detail you add, the better our API can understand the user's intent.
Less Effective:
"bag"
More Effective:
"leather tote bag for work with a laptop sleeve"
Focus on User Intent and Use Case
Instead of just describing the item, describe what the user wants to *do* with it. This helps our semantic search find products that fit the user's lifestyle and needs.
Item-focused:
"black running shoes"
Intent-focused:
"comfortable shoes for running on pavement daily"
Combine Semantic Search with Filters
Use the `query` for descriptive, semantic information and the `filters` object for hard constraints like price, brand, and color. This is the most powerful way to search.
Example:
A user wants "a fancy espresso machine that's easy to use, maybe a Breville, under $700".
{
"query": "easy to use home espresso machine for beginners",
"filters": {
"max_price": 700,
"attributes": {
"brand": "Breville"
}
}
}What to Avoid
- • Keyword Stuffing: Do not simply list keywords like "shoe running black nike cheap". Use natural, conversational language.
- • Sending Instructions: Do not include instructions to the API in the query, such as "find me a product" or "search for...". Only include the description of the desired item.
- • Overly Narrow Queries: While specificity is good, being too niche may yield no results (e.g., "a left-handed, titanium, 7-inch spork made in Sweden"). If you get no results, try removing the least important descriptor.