IndexDen E-commerce cheat sheet

In this tutorial I will collect best practices and most useful information about creating e-commerce application using IndexDen. I will talk about such entities like Products, Categories and Custom fields which are the basic data of any e-commerce application.

Getting started

Download IndexDen API client library:
IndexDen API’s client libraries overview

Documentation and tutorials for most common libraries:
PHP, Python, Ruby, Java, .NET and Rails

Must read before start programming:

This is only first “Getting started!” part of the tutorial. In next part I will describe how to organize data like Products, Categories and Custom fields in indexes to gain maximum of IndexDen abilities.



How IndexDen supporting languages?

Language support is very important in now days, because we operating globally we have to make sure that any language are supported by IndexDen.
What kind of language support do we provide:
1) Search in Unicode
2) Morphology
3) Phonetic or Soundex support
4) Did you mean feature

This article explain what we did and what we will do to support different languages.


There are two most common input methods in use today are single-byte encoding and UTF-8.
IndexDen search are supported UTF-8 encoding, it means it cover all kind of languages.
Including variations of Chinese, Japanese, Korean and Vietnamese languages.


Morphology preprocessors can be applied to the words being indexed to replace different forms of the same word with the base, normalized form. For instance, English stemmer will normalize both “dogs” and “dog” to “dog”, making search results for both searches the same.
In the time being IndexDen support only English and Russian stemmers.

But, by custom request we also could provide support for following languages:

  • French
  • Spanish
  • Portuguese
  • Italian
  • German
  • Dutch
  • Swedish
  • Norwegian
  • Danish
  • Finnish
  • Arabic
  • Czech

Phonetic or Soundex support

Soundex is a phonetic algorithm for indexing names by sound, as pronounced in English. The goal is for homophones to be encoded to the same representation so that they can be matched despite minor differences in spelling.


We got a lot of requests to support Soundex analyze of words. This is very useful when you need to search by First name, Last name, Street and other genealogical information.
As it is not common for the most of our customers it will be supported only on custom request basis.

Did you mean … ?

Many of our customers requested for “did you mean … ?” functionality from IndexDen.
I think your already know what it is from Google search. In short it is based on comparing the difference between the words in the current query and words from a dictionary.
We already have a plan how to implement it, but it is not easy as it sounds.
This feature also will be enabled by custom requests for our customers.

Search in Unicode – working for any language including Chinese, Japanese, Korean and Vietnamese languages.
Morphology – by default working for English and Russian language. By request could be enabled for other languages, see the list above.
Phonetic or Soundex support – will be enabled by request.
“Did you mean ..?” feature – will be accessible for all tariff plans except Free plan.

If you want to try and incorporate any of this feature into your application you have to sign up to paid plain.
See plans and pricing which will fit you best.

Feel free to ask any questions or support request.

How Facets works in IndexDen?

What is Facets in search?

Faceted search, also called faceted navigation or faceted browsing, is a technique for accessing information organized according to a faceted classification system, allowing users to explore a collection of information by applying multiple filters.

Adding Facets to documents

Documents already added can be categorized. Categories are a way to partition your index for different dimensions. For every category (the dimension) every document can have multiple values.

Each category is defined by string, and its values are also defined by strings. So for instance, you can define a category named “articleType” and its values can be “camera”, “laptop”, etc… You can have another category called “priceRange” and its values can be “$0 to $49″, “$50 to $100″, etc…

$categories = array('priceRange' => '$0 to $299',
                   'articleType' => array('camera', 'electronics'));
$index->update_categories($docid, $categories);

Facets in a search results

When searching, you will get an attribute in the results called “facets”, and it will contain a dictionary with categories for keys. For each category the value will be another map, with category value as key and occurrences as values. So for instance:

    'matches': 8,
    'results': [ {'docid': 'doc1'}, ... ],
    'facets': {
        'articleType': {
            'camera': 5,
            'laptop': 3,
	    'electronics': 8
        'priceRange': {
            '$0 to $299': 4,
            '$300 to $599': 4

Means that from the matches, 5 are of the “camera” articleType, 3 are “laptop” and 8 are “electronics”. Also, 4 of them all are in the “$0 to $299″ priceRange, and 4 on the “$300 to $599″.

Facets as filters in search query

Then, you can also filter a query by restricting it to a particular set of category/values. For instance the following will only return results that are of the “camera” articleType and also are either in th “$0 to $299″ or “$300 to $599″ price range.

        array('priceRange' => array('$0 to $299', '$300 to $599'),
              'articleType' => array('camera'))

To see how it works Sing up to IndexDen for Free.