AI can quickly create product listing APIs, search bars, and sorting buttons. However, which products to display, which to hide, and what to label as “recommendations” are determined by operational policies, not code. E-commerce search is not merely a lookup function; it is a decision-making system that integrates shelf placement, ad space allocation, inventory management, customer experience, and data collection all in one place.
If you simply instruct the AI to “build a product search feature” without providing specific policies, it may arbitrarily fill in familiar examples such as sorting by most recently added, partial product name matches, or simple pagination. Even if the code runs, it may not align with store operations. Typical issues include the latest products appearing at the top even when they’re out of stock, discontinued items being added to shopping carts, and customers failing to find “Cheongsong Busa” apples even when they search for “apples.”
Search Ranking Is an Operational Policy, Not a Technical Feature
Merchants can design the order in which products are displayed. However, if the meaning conveyed to consumers on the screen does not align with the actual ranking calculation method, or if sponsored listings with economic interests are made to appear like general recommendations, the legal and trust-related risks increase significantly.
In June 2024, the Korea Fair Trade Commission (KFTC) announced a provisional fine of 140 billion won against Coupang and CPLB for issues related to search ranking operations and the posting of purchase reviews by executives and employees; based on the resolution issued in August of the same year, the fine was set at 162.8 billion won. The companies contested the decision, and as of April 2026, the related lawsuit seeking to overturn the ruling was still pending. The practical lesson from this case is not simply the proposition that “favoring one’s own products is always illegal.” It is essential to review at the design stage what the “recommendation” label actually means, whether advertising and the company’s vested interests are clearly disclosed, and whether changes in rankings can be explained with data and documentation.
Since the application of the law can vary depending on the service structure and display methods, it is safest to separately verify relevant laws and the latest enforcement precedents before the actual launch.
The Pitfalls of a “Quick-and-Dirty Version” Created by a One-Line Prompt
| Undefined Policy | Implementation Where AI Can Fill in Arbitrarily | Actual Operational Risks |
|---|---|---|
| Default Sorting | created_at DESC |
Recently listed out-of-stock or pre-inspection products appear at the top |
| Sales Status | Checks only whether an item has been deleted | Products that have been discontinued or recalled may appear in search results or be available for order |
| List Loading | Full retrieval or simple infinite scrolling | Slow response, loss of position when using the back button, difficulty comparing items |
| Search Scope | Partial match on product name only | Fails to search by brand, variety, model name, or synonyms |
| No Results | Returns only an empty array | Customers with high purchase intent immediately leave |
| Logs | Search terms, member IDs, and IP addresses are stored as-is | Risk of data collection beyond intended purposes, excessive retention, and exposure of sensitive search terms |
AI can fill in the gaps in requirements, but it cannot determine whether those choices align with the store’s strategy and legal responsibilities. Therefore, at least the following five policies must be documented and finalized before implementation.
1. Default Sorting: What Will Be Considered “Recommended Order”?
The default sorting order is the display customers see first. Since most users do not change the sorting options, the default setting directly impacts sales, inventory depletion, new product promotion, and customer satisfaction.
First, Separate the Ranking Calculation Steps
It is safer to divide search results into the following steps rather than calculating them all at once.
- Eligibility Check: Include only products that are available for sale, publicly viewable, and not subject to legal or operational restrictions.
- Calculate Search Relevance: Calculate how well the product name, brand, category, attributes, and synonyms match the search query.
- Calculate Organic Ranking: Combine signals such as sales velocity, conversion rate, rating reliability, and delivery quality.
- Application of Business Rules: Apply penalties for out-of-stock items, prioritize new product discovery opportunities, and enforce diversity limits.
- Ad Slot Integration: Insert ad products separately from organic rankings and clearly label them.
-
Stable Tie-Breaking: When scores are tied, order is determined using a fixed key such as
product_id.
The recommendation score must be a documented formula
The following is merely an example to illustrate the structure; it is not a one-size-fits-all solution for every online store.
organic_score =
0.45 × query_relevance
+ 0.20 × conversion_rate_28d
+ 0.15 × sales_velocity_14d
+ 0.10 × rating_confidence
+ 0.10 × fulfillment_quality
Each signal must be normalized to the same range, and the time period and aggregation scope must be specified. Since a simple average rating could make a product with a single 5-star review appear higher-rated than a product with 1,000 reviews averaging 4.8 stars, it is better to use a weighted score that accounts for the number of reviews. Using only sales volume could give products that have been on the market for a long time a permanent advantage, so we also consider recent sales velocity and conversion rates.
Essential Details to Define
- Which of the following is the goal of the recommendation ranking: search relevance, purchase likelihood, customer satisfaction, or inventory efficiency
- The aggregation period and update frequency for each signal
- Negative signals such as cancellation rates, return rates, shipping delays, and the likelihood of being out of stock
- The exploration opportunities and maximum bonus points to be granted to new products with few reviews
- Diversity rules to prevent a single brand or seller from excessively dominating the top of the rankings
- A fixed sorting key to use in case of tied scores
- An audit log documenting the version of the ranking formula, reasons for changes, implementation dates, and approvers
- Success metrics and termination conditions for A/B testing
Do not mix paid ads with organic recommendations
While it is acceptable to reflect economic interests—such as advertising spend, whether a product is the company’s own, or high profit margins—it is risky to allow users to mistake this for a general “popularity” or “recommended” ranking. In the 2025 case involving a high-end product sales platform, the Fair Trade Commission took issue with a system where products from sellers who purchased paid options were given priority in the default sorting, as well as the related labeling. As a general rule, advertised products should be managed in separate pools and slots, and clearly identifiable “Ad” or “Sponsored” labels should be provided at the card level. The admin dashboard must display advertising exposure rules and organic ranking algorithms separately.
2. Products in Abnormal States: Out of Stock and Sales Suspension Are Different States
If you handle all exceptions with just is_sold_out, discrepancies will arise between search results, product details, the shopping cart, and order verification. At a minimum, you must separate sales status, inventory status, visibility status, and regulatory status.
Recommended Status Model
| Status | Search/Listings | Direct URL Details | Cart/Order | Recommended Handling |
|---|---|---|---|---|
| For Sale · In Stock | Normal display | Normal display | Possible | Default candidate |
| For Sale · Temporarily Out of Stock | Displayable but with lower ranking or demoted | Display “Out of Stock” and “Restock Notification” | Not possible | Preserve restock possibility |
| Temporarily Suspended | Hidden by default | Notice of suspension | Not allowed | Restore upon resumption |
| Discontinued | Hidden from search and categories | Notice of discontinuation and alternative products | Not allowed | Preserve existing links and customer service context |
| Draft·Under Review | Completely hidden | Accessible only to authorized administrators | Not allowed | Review before publication |
| Recall·Legal Block | Completely hidden | Safety notice if necessary | Not allowed | Safety notices take priority over alternative recommendations |
Out-of-stock products are valuable for restock notifications and gauging search demand, so they do not need to be deleted unconditionally. On the other hand, discontinued products should be excluded from general listings; however, customers arriving via existing bookmarks or external links can be provided with a “Sales have ended” message and similar products. Whether to retain the product detail URL or return a 410 Gone status should be determined based on search traffic, the need for legal notices, and the value of alternative content.
The search index does not have the final authority on order availability
Search indexes may experience synchronization delays. Therefore, even if search results show that an item is in stock, it must be verified again at the next stage.
- Re-verify sales status and inventory when adding to the cart
- Re-verify price, discounts, and inventory when proceeding to the order form
- Reserve inventory or perform atomic deduction immediately before checkout
- Immediately remove items from the search index when a “Sale Stopped” event occurs
- Monitor indexing latency and failure rates
Without these rules, customer service incidents will recur where the search results appear normal but the order fails only at the checkout stage.
3. List Display Methods: Paginated, “See More,” or Infinite Scroll—Which Should You Use?
If there are thousands or tens of thousands of products, they should not all be loaded at once. However, it is also inaccurate to assume that “numeric pagination is always the right answer for online stores.” In comparison-based searches, restoring position and state is important, while “Load More” may be more convenient for category browsing.
| Method | Strengths | Weaknesses | Ideal Scenarios |
|---|---|---|---|
| Numeric Pagination | Easy to understand current position and result volume; allows revisiting specific pages | Page transitions are disjointed, and comparing across pages is cumbersome | Desktop search, deep exploration, shareable results |
| See More | Allows users to control loading while retaining existing content | DOM and memory usage increase when there are a large number of results | Mobile and category browsing, medium-sized result sets |
| Infinite Scroll | Natural, continuous browsing | Unclear position, end point, and total volume; difficult to restore previous pages | Feed-style screens where discovery is more important than comparison |
In practice, you can prioritize pagination or “See More + restorable page URLs” for search results, and infinite scroll for discovery-based recommendation feeds. Even when using pure infinite scroll, the following conditions must be met:
- Save the search term, sort order, filters, page number, or cursor position in the URL or in a restorable state
- Restore the previous product and scroll position when navigating back from a detail page
- Support keyboard navigation, screen readers, and focus movement
- Provide accessible alternatives for the footer and primary navigation links
- Provide a UI for loading failures and retries
- Provide an accessible, unique URL or link structure for each result batch
Offset and Cursor Pagination
Deep offsets like OFFSET 5000 LIMIT 40 tend to slow down as the data volume increases and updates become more frequent, and they are prone to duplication andomissions. While offsets are simple for shallow pages and admin screens, the cursor method—which passes the sort key of the last result—is more stable for large-scale searches.
ORDER BY score DESC, product_id DESC
cursor = last_score + last_product_id
Using only the score as the cursor may omit products with tied scores, so a unique key is used in conjunction with it. If recommendation scores change frequently in real time, a policy is also needed to fix a snapshot version or a specific time for the ranking criteria during the search session.
4. Search Scope and “No Results” Page: Linking Customer Queries to Product Data
Customers do not know the exact product names registered by the operator. To show “Cheongsong Busa,” “Hongro,” and “household apples” to a customer searching for “apples,” the product data and search dictionary must be designed together.
Search Field Priorities
| Field | Recommended Priority | Example |
|---|---|---|
| SKU, Model Name, Barcode | Very High |
SM-S928N, 880...
|
| Product Name | High | Cheongsong Busa Apples 3kg |
| Brand·Manufacturer | High | Samsung, Apple |
| Category·Product Type | Medium or higher | Fruit, Running Shoes |
| Key Attributes | Medium or higher | Capacity, Color, Size, Compatible Models |
| Synonyms·Aliases·Varieties·Tags | Medium or higher | Jogging Shoes ↔ Running Shoes, Apple ↔ Busa |
| Detailed Description | Low | Low weighting to reduce noise in long descriptions |
| Review Body | Optional | Used sparingly after reviewing for quality, spam, and personal information |
For Korean searches, differences in spacing, separation of letters and consonants, brand names in English and Korean, numbers and units, and compound nouns must also be considered. For example, “AirPods Pro 2,” “AirPods Pro 2,” and “AirPods Pro 2” are all mapped to the same product category through normalization rules.
Recommended Search Pipeline
- Validate input length and allowed characters.
- Normalize case, spaces, special characters, and units.
- First, check for an exact match with the product code.
- Apply tokenization and morphological and spelling variations.
- Expand the synonym and category dictionaries managed by the operator.
- Find candidates using text search.
- If necessary, use semantic search to generate additional candidates.
- Filter by sales, public availability, and regulatory status.
- Calculate organic scores and combine them separately with ads.
- Return results and diagnostic information.
Even when introducing generative AI or vector search, exact matches such as SKUs, brands, and model names must not be compromised. In shopping search, a hybrid approach combining exact search + text relevance + optional semantic search is generally the safest approach. All responses must be linked to actual product IDs and current data to prevent AI from inventing products, prices, or inventory that do not exist in the catalog.
The “No Results” Screen Is Your Second Shelf
When there are no search results, do not simply display a blank screen. However, you should also avoid mixing in unrelated popular products as if they were search results.
The recommended structure is as follows:
- Display the user’s search query exactly as entered and clearly indicate that there are no matching products
- Offer typo correction suggestions and synonym recommendations
- If the count is 0 due to filters, provide guidance on which filters can be removed
- Present results with broader search criteria under a separate label
- Display related categories, alternative products, and all popular products separately
- Include options to request restocking or new listings, or link to customer support
- Log searches with no results in the administrator’s analytics
“No results” and “No results after applying filters” are different issues. If there were originally matching products but the count dropped to zero due to price or color filters, relaxing the filters is the most useful solution; if the product is not in the catalog at all, the data should be used for sourcing purposes.