indexing - how should I think about search engine indices? -


i using elastic search , not understand index is. example, if have 3 models (a backpack, shoe , glove), put each model in own index or index attributes of each model: ie index shoe's laces, sole, etc?

i trying understand if slow search across indices. example, if index each attribute of models , have say, 20 indices, when run search needs @ data in of indices, slower having single index , looking @ 20 attributes stored in index?

in elasticsearch, index consists of 1 or more primary shards, shard lucene instance. each primary shard can have 0 or more replicas, existence gives high availability , increased search performance.

a single shard can hold lot of data. however, multiple shards easier distribute workload across multiple processors , multiple servers.

that said, need balance. right number of shards depends on data , context. shards aren't free, while useful have thousands of shards if you're running 100 node cluster, don't want on single node.

in elasticsearch, having indices, have concept of types. think of index being database, , type being table.

using different types has no overhead, , fits better example having separate indices.

you can still search across types (or selected list of types) , across indices (or selected list) or combination.

each type can have own fields (like columns in table) .

so in example, i'd have 1 index containing 3 types, each own fields. start default number of primary shards (5) , default number of replicas (1) , change these when understand data better.

note: don't confuse index in elasticsearch index in database


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -