searchAnalytics buildAutoComplete

E-commerce Product Search Optimization

Scénario de test & Cas d'usage

Business Context

An online electronics retailer wants to implement an auto-complete feature on their homepage search bar. The goal is to suggest valid product categories and names (e.g., 'Wireless Headphones', 'Smart TV') as the user types to improve conversion rates and user experience.
About the Set : searchAnalytics

Data indexing and search functionalities.

Discover all actions of searchAnalytics
Data Preparation

Creating a dataset of product descriptions and generating the initial term index required for the autocomplete build.

Copied!
1DATA mycas.products; LENGTH product_desc $100; INFILE DATALINES truncover; INPUT product_desc $ &; DATALINES;
2Wireless Bluetooth Headphones Black
3Noise Cancelling Over-Ear Headphones
4Smart 4K Ultra HD LED TV
5Portable Waterproof Bluetooth Speaker
6Gaming Laptop 16GB RAM
7Digital SLR Camera Kit
8; RUN;
9 
10PROC CAS; search.buildTermIndex / TABLE={name='products'} docId='product_desc' casOut={name='product_terms', replace=true}; RUN;

Étapes de réalisation

1
Execution of buildAutoComplete using the product term index.
Copied!
1 
2PROC CAS;
3searchAnalytics.buildAutoComplete / index={name='product_terms'} casOut={name='product_autocomplete', replace=true};
4 
5RUN;
6 
2
Verification (Optional): Fetching a few rows to ensure the index structure is created.
Copied!
1 
2PROC CAS;
3TABLE.fetch / TABLE={name='product_autocomplete'} to=5;
4 
5RUN;
6 

Expected Result


The action successfully processes the 'product_terms' table and generates the 'product_autocomplete' table. This output table contains optimized n-grams or term fragments ready to be queried by a search interface for instant suggestions.