3

How would you structure indices/types for an eshop application? Such an eshop would consist of domain objects like product, category, tag, manufacturer etc. The fulltext search results page should display intermixed list of all domain objects.

I can think of two options:

  1. One index per whole application, every domain object as a type.
  2. Every domain object has its own index, the type is the same - "item".

Which option will scale better?

The most of the "items" in the database are products. Some products aren't yet/anymore available. How to boost currently available products?

The fulltext should prefer to show categories/manufacturers on top of the page. How to boost certain types / objects from certain index?

Jakub Kulhan
  • 1,572
  • 2
  • 16
  • 37
  • This is a fairly big question that has several variables. If you can provide a sample set of documents, or more information (feel free to use sense.qbox.io/gist/, I might be able to help. The biggest issue is the data and structure of how you will be searching. There are certainly some fairly standard conventions with eshop search in Elasticsearch, but this is a fairly big question. – Michael at qbox.io Feb 18 '14 at 15:31
  • 1
    These are the mappings I would use (if everything would be in one index). http://sense.qbox.io/gist/72a7cea515d4c116a93d529a025ed89161c92796 The thing is the whole frontend listings should run on ES - i.e. filtering by category/tag should be as fast as fulltext search. – Jakub Kulhan Feb 18 '14 at 17:16

1 Answers1

2

For better performance i suggest first option is better one.

1)"One index per whole application, every domain object as a type."

2)Consider you create an index named "eshop".And types such as mobile,book etc

3)Because you can query according to your user input.Consider you create a shopping website like flipkart.In search user can search with plain keyword.

4)Now you can search in Elasticsearch with only mentioning index name.If user refer sum filter like mobile,range 1000-10000.you need to search inside mobile type,moreover we can easily filter in Elasticsearch.it will reduce your execution memory and CPU.

To boost available products.Add a field called "available" in your document.And while searching mentions boost value for available product.Example:

    {
      "query": {
        "term": {
          "available": true
        }
      }
      "boost": 1.5
    }

For more Boosting refer

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-boosting-query.html

http://jontai.me/blog/2013/01/advanced-scoring-in-elasticsearch/

BlackPOP
  • 5,657
  • 2
  • 33
  • 49