Cognito Search
Go to App

Categories

Categories feed

A Categories feed describes your category pages. It plays two roles:

  1. Category pages become searchable results in their own right.
  2. It is the lookup table that turns the category names on products and articles into real links — each <category> value on a product/article is matched against the hierarchy field here. Without a Categories source, those category names are still indexed but have no URL.

Register the feed as a source of type Categories.

Structure

  • Root element: <categories>
  • Item element: <category> (zero or more)
<?xml version="1.0" encoding="UTF-8"?>
<categories>
<category>
<name>OTC medicines</name>
<url>https://shop.example.com/c/otc-medicines</url>
<hierarchy>Pain &amp; fever | OTC medicines</hierarchy>
<image_link_s>https://shop.example.com/img/otc-s.jpg</image_link_s>
<image_link_m>https://shop.example.com/img/otc-m.jpg</image_link_m>
<image_link_l>https://shop.example.com/img/otc-l.jpg</image_link_l>
</category>
</categories>

DTD

<!ELEMENT categories (category*)>
<!ELEMENT category (name, url, hierarchy, image_link_s?, image_link_m?, image_link_l?)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT url (#PCDATA)>
<!ELEMENT hierarchy (#PCDATA)>
<!ELEMENT image_link_s (#PCDATA)>
<!ELEMENT image_link_m (#PCDATA)>
<!ELEMENT image_link_l (#PCDATA)>

Children must appear in the order shown above.

Elements

ElementRequiredTypeSearchedMeaning
nameyestextyesDisplay name of the category (e.g. "OTC medicines"). Full-text and prefix searchable.
urlyestextnoLink to the category page. This is the URL attached to products/articles whose category matches this entry's hierarchy.
hierarchyyestextnoFull category path, used as the match key. Conventionally a |-separated path from root to leaf (e.g. "Pain & fever | OTC medicines"). A product/article <category> must contain this exact string to resolve to this entry's url.
image_link_snotextnoSmall image URL.
image_link_mnotextnoMedium image URL.
image_link_lnotextnoLarge image URL.

Keep hierarchy consistent across feeds. The value a product or article puts in <category> must equal this hierarchy verbatim — including spacing and separators — or the link will not be resolved.