0

I am designing an e-Commerce site with multiple warehouse. All the warehouses have same set of products. I am using ElasticSearch for my search engine. There are 40 fields each ES document. 20 out of them will differ in value per warehouse, rest 20 fields will contain same values for all warehouses.

I want to use multiple types (1 type for each warehouse) in 1 index. All of the types will have same mappings. Please advise if my approach is correct for such scenario.

Few things not clear to me,

  1. Will the inverted index be created only once for all types in same index?
  2. If new type (new warehouse) is added in future how it will be merged with the previously stored data.
  3. How it will impact the query time if I would have used only one type in one index.

1 Answer 1

1
  1. Depending on all types being assigned to the same index, it will only created once and
  2. If a new type is added, its information is added to the existing inverted index as well - adding new terms to the index, adding pointers to existing terms in the index, adding data to doc values per new inserted document.
  3. I honestly can't answer that one, though it is simple to test this in a proof of concept.

In my previous project, I experienced the same setting implementing a search engine with Elasticsearch on a multishop-platform. In that case we had all shops in one type and when searching per shop relevant filters were applied. Though, the approach to separate shop-data by "_type" seems pretty clean to me. We applied it the other way, since my implementation was already able to cover it by filters at the moment of the feature request.

Cheers, Dominik

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.