Sizes and units in site search: inches, millimeters and threads

Why 1/2 inch, 1/2" and ½ in don't match in plain text search, how to normalize sizes, threads and ratings, and what to keep as it is.

In a technical store, a size is often the most precise thing a shopper knows. They measured the old bearing, read the thread off a drawing, or know the wiper blade is 60 centimeters. Then they type it, in whatever style comes to mind.

Plain text search splits text into words and compares them. Sizes don’t survive that well:

The catalog saysThe shopper typesWhat plain text search sees
1/2"1/2 inch“1/2” plus a quote mark vs “1/2” plus the word “inch”
600 mm60 cmtwo different numbers and two different units
1,5 kW1.5kw“1,5” and “kW” vs one unknown word “1.5kw”
20x47x14 mm20 x 47 x 14one word vs five words
M8x1.25m8 x 1.25one word vs three words

Some of these work by luck, when the important number happens to be its own word. Many don’t.

Normalize measurements, both sides

The fix is to read every measurement, in the catalog and in the search, and turn it into one canonical form before comparing. A workable set of rules:

  • Fractions and inches. 1/2", 1/2 in, 1/2 inch, ½" and ½ in all become one token meaning half an inch. Mixed numbers too: 1-1/4" and 1 1/4 inch.
  • Pipe threads count as inches. 3/8 NPT means 3/8” NPT even without the inch mark. The same goes for BSP, BSPP, BSPT, UNF and UNC.
  • Lengths compare in millimeters. 60 cm, 600 mm and 0.6 m become 600 mm.
  • Dimensions stay together. 20x47x14 mm, 20 x 47 x 14 and 20×47×14 become one dimension token. It also helps to index each part, so o-ring 20mm can find a 20 x 3 mm ring.
  • Metric threads keep their pitch. M8x1.25 and M8 x 1.25 become one thread token, different from M8x1.0. A plain M8 matches M8 threads.
  • Decimal commas and points are equal. 1,5 kW and 1.5 kW.
  • Units have one spelling. 230 V, 230V and 230 volt; 25 A and 25 amp; 4000 K and 4000K.

Keep part numbers as they are

The same rules must not touch part numbers. 6204-2RS is a bearing code, not “6204 minus 2”. M8-30-A2 might be your SKU. A size parser that rewrites codes will break the searches that matter most.

The safest approach is to match part numbers first, with separators ignored, and only then read the rest of the query for sizes. See how to make part numbers searchable.

Don’t convert what the trade doesn’t convert

Not every size should be converted:

  • Nominal sizes. A 1/2” pipe thread is not half an inch across. Converting it to 12.7 mm would match the wrong products. Match the ways of writing 1/2”, but don’t turn it into millimeters.
  • Mixed systems. DN15 and 1/2” are often used for the same pipe size, but not always. Treat this as a synonym you choose, not a conversion.
  • Approximate equivalents. 24” and 600 mm wiper blades are close, not equal. Let the shopper decide.

Test it on your own catalog

Pick ten products with sizes and search each size three ways. For example:

  • 1/2" ball valve, 1/2 inch ball valve, ½ in ball valve
  • bearing 20x47x14, bearing 20 x 47 x 14, 20×47×14 bearing
  • wiper 600 mm, wiper 60 cm, wiper 600

If the three searches give different results, your search is comparing characters, not sizes.

How Tolra handles it

Tolra reads sizes in product titles, variant names, metafields and approved AI filter values, and stores them as canonical size tokens in their own field. The search query goes through the same rules, so 1/2 inch ball valve and 1/2" ball valve are the same search. Part numbers are matched first and never rewritten. You can try it with the sample catalog in the interactive demo, including M8x1.25, wiper 60 cm and 1,5 kW motor.

Questions

Should I convert all inch sizes to millimeters?

No. Pipe threads and many fittings are sold by their inch size even though it isn't a real measurement (a 1/2" BSP thread is about 21 mm across). Keep the size the trade uses, and let search match the different ways of writing it.

What about DN sizes for pipes?

DN (nominal diameter) and inch sizes are related but not equal, and the match depends on the pipe system. If your shoppers use both, add them as synonyms per product type rather than relying on a conversion.

Do shoppers really type sizes?

In technical stores, often. A size is frequently the only thing a shopper knows for sure: the bearing is 20 x 47 x 14, the thread is 1/2 inch, the blade is 60 cm.

Examples use made-up brands and part numbers unless a real format is needed to show the point. Try them in the interactive demo.

Try it on your own catalog

Tolra makes part numbers, sizes and codes searchable in any format. See it on a sample catalog first.