How to structure indexes / types of Elasticsearch?

How would you structure indexes / types for an eshop application? Such an eshop will consist of domain objects such as product, category, tag, manufacturer, etc. On the full-text search results page, a mixed list of all domain objects should be displayed.

I can imagine two options:

  • One index for the entire application, each domain object as a type.
  • Each domain object has its own index, the same type is an “element”.

Which option will scale better?

Most of the "elements" in the database are products. Some products are not yet available. How to increase current products?

Full-text should prefer to show categories / manufacturers at the top of the page. How to increase certain types / objects from a specific index?

+3
source share
1 answer

For better performance, I propose the first option better.

1) "One index for the entire application, each domain object as a type."

2) Consider that you created an index called " eshop ". And types like mobile, book, etc.

3) Because you can request according to your user input. Please note that you are creating a shopping website, for example flipkart. In the search, the user can search with a simple keyword.

4) Elasticsearch . , , 1000-10000. , , Elasticsearch.it, .

. . boost . :

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

Boosting

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

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

+2

All Articles