The study on site search trends in fashion eCommerce that I did together with Doofinder (a site search platform for online stores) is out now. We looked at how people search inside Spanish online fashion stores: what product types they ask for, which attributes they use to narrow things down, how much weight brands carry and which occasions drive purchases.

In this post I share the “behind the scenes”: how you go from a CSV with 3.3 million searches (with privacy criteria applied) to data you can make decisions with. I think the methodology choices could be useful for other people facing a similar classification task. I've analyzed, classified and clustered far more data than this in very different ways, but this time I'll walk you through why I made the decisions I made.
The initial raw data
I was given the searches that users typed between January and April 2026 into the site search of stores that sell fashion in Spain and use Doofinder. To protect privacy and keep only representative demand, the only queries included were those that had at least 50 searches and showed up in at least 5 different stores. So no single-store long tail that could identify a retailer or a person.
After normalizing (lowercase, whitespace, and merging identical variants), we were left with 7,790 unique queries adding up to 3.3 million searches, so “easy peasy lemon squeezy”. Zipf's law at its finest.
Half of the "fashion" wasn't fashion
When I opened the data, I found queries like "omega 3", "air fryer" and "collagen" sitting right next to "dresses" and "ankle boots". The reason is that a lot of fashion stores don't sell only fashion. In Doofinder they're grouped by their main vertical, but their catalog is mixed (health and pharmacy products, home appliances, food).
So the whole corpus was classified, separating fashion from non-fashion. The model (Claude Sonnet; I'll explain later why that one and not another) labeled each query with a three-state field: fashion, not fashion, or don't know. "Dresses" is fashion, "omega 3" isn't, and "navy blue" is a "don't know". So I took out everything confirmed as non-fashion, which turned out to be 45% of the volume (1.48 million searches), and the remaining searches (1.83 million) are what the report works with.
Of those 1.83 million, 1.15 million searches had a specific fashion product type assigned, and only those go into the rankings of types, subtypes, attributes and brands. The ambiguous ones (standalone colors, occasions on their own, unresolved numbers) can't go into the product rankings because they don't name a product, but I don't throw them away either: they feed the report's cross-cutting dimensions, like purchase occasion.
This was the most important cleanup decision in the whole process.
Why we didn't use clustering
Whenever you tell people you've classified thousands of queries, someone always asks: why not just cluster them with embeddings and call it a day? Because the task was to understand what the user is asking for, not to group similar texts. Let me explain:
- A query isn't one category, it's several facets at once. "Girls waterproof boots" packs product type, gender and attribute into three words. An embedding gives you proximity to a point in space, and we needed to break each query down into product, brand, attributes, gender and occasion. To do that, you'd need as many similarity systems as there are facets.
- Most site search queries are 1 to 3 words long. So there's often no semantic context to hold on to. The embedding of "530" means absolutely nothing, and knowing that "jordan" implies footwear in this context isn't a matter of text similarity.
- Cosine similarity never abstains. It always gives you a nearest neighbor. With half the dataset being non-fashion, "omega 3" would have landed on whichever fashion node happened to be closest, unless you hand-tune thresholds for every case. An LLM can answer "this isn't fashion" or "I don't know", and that honesty was exactly what we needed for the cleanup I described above.
- Topics are unstable and you have to name them after the fact. That can work for a one-off snapshot, but this study is designed to be repeated every season and compared. And you can't do that with clusters that change with every run.
- The cost was very low. After cleaning there were 7,790 queries, and the classification cost about $5 in API calls. ML clustering pays off when the volume makes running an LLM unfeasible, and that wasn't the case here.
Classifying against a closed taxonomy
That said, an LLM will invent categories faster than you can ask for them. That's why the classification was done against a closed vocabulary: for each product, the model had to pick an exact node from the official Google Shopping taxonomy in Spanish (the "Apparel & Accessories" branch, "Ropa y accesorios" in Spanish), or null. I chose that taxonomy because it's an industry standard, stable across periods and familiar to anyone who works with product feeds.
If you've worked with Merchant Center feeds, you'll know that Google's taxonomy has a problem with "Shoes": it's just a single node. It splits clothing into dozens of types, but it doesn't have even one shoe family.
So the solution was a custom subtype facet, with the same closed-vocabulary philosophy: 17 footwear subtypes (boots, ankle boots, sandals, sneakers, heels, wedges...), and I took the chance to add about twenty clothing subtypes that Google doesn't separate from a commercial point of view either. Synonyms were merged into one canonical label ("sneakers" and "trainers" are the same family), and there were two escape hatches: "unspecified" for generic queries and "other" when nothing fits.
Besides product type, the model extracts brand, attributes, gender, occasion, and signals like sales or plus size. And it works with strict rules:
- Don't go down a level without evidence: "clothing" stays in the generic category, "party dresses" goes down to the specific node. An embedding's nearest neighbor can't calibrate depth like this, but a well-instructed LLM can.
- No making up brands. No clear brand = null.
- No guessing from bare numbers (we'll get to this in a moment).
- Confidence: low for ambiguous, truncated or noisy queries.
How to measure the error
Before classifying anything, I hand-labeled a golden set of about 200 queries, with easy cases and traps (typos, numbers, ambiguous brands, non-fashion). With that golden set, I benchmarked 3 Claude models on product type:
| Model |
Product type accuracy |
| Opus 4.7 |
97.8% |
| Sonnet 4.6 |
94.4% |
| Haiku 4.5 |
92.2% |
On brand and attributes, Sonnet and Haiku matched or beat Opus. With all three models within a few points of each other, we went with Sonnet: about $5 per run versus nearly double that with Opus. For structured extraction against a controlled vocabulary, you don't need the most expensive model, and an error rate of around 5% is totally acceptable for a trends study.
What I did with bare-number queries
"530", "501", "9060"... anyone who runs a shoe store knows that people search for sneaker models by typing just the number. We banned the model from guessing here, because an LLM will happily tell you that "501" is Levi's even if your store only carries New Balance.
So to disambiguate, I checked each number against the dataset itself, within the same store: if that store has sibling queries like "new balance 530", the number inherits that brand and product type by voting. If there's no strong internal evidence, the system abstains, and that volume gets reported as unresolved instead of being filled in with a hallucination.
Reproducible by design
The whole pipeline runs with a single command, and each phase is cached per period: classification, numbers, subtypes and occasions. So when you rerun it on the same period, no query gets classified again, which keeps things as deterministic as possible. And the final aggregation that produces the report's rankings is deterministic code.
That way we can repeat the analysis with next season's data, using the same taxonomy and the same way of measuring error, so comparisons over time actually make sense.
Take a look at your own site search
I've been doing Site Search Analysis for years, since back when it was done with server logs, thanks to what I learned from Louis Rosenfeld's well-known book Search Analytics for Your Site. I've given several talks about it since 2014 at business schools and events (this one is from 2016, at eShow, an ecommerce trade show in Spain).

To me, site search is the cleanest and most powerful source of first-party data an ecommerce site has. It's literally your customer typing, in their own words, what they want, and often can't find. It reveals navigation patterns, helps you define your site architecture, shows you usability and UX issues… The data is amazing. The aggregated industry patterns are in the report, but the real gold mine is in the search reports of your own store. And if you don't have a powerful site search, use Doofinder 🙂