AI Search
Enhance your e-commerce experience with Wearly's AI-powered search capabilities
Overview
Wearly's AI Search is a powerful natural language search solution designed specifically for fashion e-commerce. It allows your customers to search for products using natural language, just as they would describe what they're looking for to a store associate.
Unlike traditional keyword-based search engines, Wearly's AI Search understands context, style preferences, and fashion terminology to deliver highly relevant results that match the customer's intent.
Key Features
Process complex search queries like "comfortable jeans for summer" or "breathable summer dresses that aren't too revealing"
Understand the meaning behind search terms, not just matching keywords, to deliver more relevant results
Understand and prioritize results based on style preferences mentioned in the search query
Interpret the context of search queries to provide more accurate and relevant product recommendations
Integration
Wearly's AI Search can be integrated into your e-commerce platform using our Firebase Cloud Functions. The integration process involves two main steps:
- Authentication: Generate a search token using the
wearly_get_request_data
function - Search: Perform the search using the
wearly_search
function with the generated token
// Import Firebase functions
import { httpsCallable } from "firebase/functions";
import { functions } from "./firebase-config";
// Step 1: Generate search token
async function getSearchToken(query) {
const wearly_get_request_data = httpsCallable(functions, "wearly_get_request_data");
const request_data = await wearly_get_request_data({
user_search_parm: query.trim()
});
return request_data.data.idToken;
}
// Step 2: Perform search
async function performSearch(query) {
try {
// Get search token
const idToken = await getSearchToken(query);
// Use token to perform search
const wearly_search = httpsCallable(functions, "wearly_search");
const result = await wearly_search({
search_token_id: idToken,
client_id: "your-client-id", // Replace with your client ID
});
// Process results
const searchResults = result.data.results || result.data;
return searchResults;
} catch (error) {
console.error("Search failed:", error);
throw error;
}
}
Response Structure
The search response contains an array of product results with detailed information about each item. Here's the structure of a typical search result item:
{
"item_images": "https://example.com/image.jpg",
"skuId": "SKU123456",
"displayName": "Slim Fit Jeans",
"sellerName": "Brand Name",
"url": "https://example.com/product/slim-fit-jeans",
"item_metadata": "slim, denim, jeans, pants, comfortable, stretchy, casual",
"price": "$89.99",
"item_name_similarity_score": 0.85,
"item_metadata_similarity_score": 0.78,
"description": "These premium denim jeans feature a comfortable fit with just the right amount of stretch.",
"wearly_description": "Elevate your style with these premium denim jeans. They combine modern design with exceptional comfort."
}
Configuration Options
Wearly's AI Search can be customized to match your specific requirements. Here are some of the configuration options available:
Configure the search to prioritize specific styles (classic, trendy, vintage, etc.) based on your brand's aesthetic
Configure the search to prioritize comfort and stretch when these attributes are mentioned in queries
Enable highlighting of sustainable products in search results when sustainability is a factor
Best Practices
Provide Search Suggestions
Offer example search queries to help users understand the capabilities of the AI search, such as "high waisted jeans that aren't too tight" or "comfortable denim for summer"
Display AI-Generated Responses
Show AI-generated responses based on search results to provide context and personalization, making the search experience more conversational
Highlight Product Metadata
Display relevant product metadata as tags to help users quickly identify why a product was included in the search results
Implement Error Handling
Always implement proper error handling to provide a graceful fallback experience if the AI search encounters issues