ElasticSearch: Performance Implications for Multiple Types in the Same Index

We store several subtypes of polymorphic documents in one index (for example, we say that we store cars with subtypes of car, van, motorcycle and Batmobile).

Currently, there is 80% commonality in the fields of these subtypes (ex manufacturer, number of wheels, awesomeness rating as a mode of transport).

A standard case is a search for all types, but sometimes users will want to filter the results in a subset of subtypes: find only cars with ...).

How much overhead (if any) is there in the search / time index when modeling these subtypes as separate ElasticSearch types and modeling them as one type using any particular application to distinguish between subtypes?

I have already looked through several related answers, but cannot find the answer to my exact question.

Many thanks!

+4
source share
1 answer

There should be no noticeable overhead.

If you save everything under the same type, you can filter the results by subtype by adding the "class" field to your objects and adding a condition to this field in your search.

A good reason to model your different classes in different ES types is a conflict between field types with the same name.

, "car" "color", , "van" "color", . ( , , ).

Elasticsearch ( ) . , "" "" , . . , , .

Elasticsearch - , .

+3

All Articles