Alternative for mapping type

  1. what is the best way to index data when i have two types .. and only one field in data is different based on the type. I have 4-5 fields for a single doc.
  2. is it good to use single index or two indexes . each for a type .. same fields in both except one field.
  3. does increasing indexes reduces performance ?

Welcome to our community! :smiley:

Given the structures are pretty much the same, the best idea is to add a new field called doc_type with a value to differentiate between the two. If the document structures start to really diverge, then split into their own indices.

Shard counts matter more than the number of indices. So try to keep your shard counts low.

1 Like

Thank u so much ... based on the type can i put different analyzer on the field data?.. while searching and while indexing.

No you cannot. You would need to have different field names to handle that.

1 Like

okay thanks .. one more doubt .. querying through sql access api or querying through dsl .. which is faster . Is there is performance difference in both.

You're better off making a new topic for that question, it just makes it easier to track things :slight_smile:

1 Like