Why did we remove multiple document types within an index in ElasticSearch?

  • Context: MHB 
  • Thread starter Thread starter shivajikobardan
  • Start date Start date
  • Tags Tags
    Index Multiple
Click For Summary
SUMMARY

The removal of multiple document types within an index in ElasticSearch is due to the inability to declare fields of different data types for the same index. For example, if an index named "college" contains document types such as "student" and "staff," a field like "date_of_join" cannot be defined as "text" in "student" and "date" in "staff." This limitation arises from Lucene's management of field types at the index level, which prevents the coexistence of multiple data types for the same field.

PREREQUISITES
  • Understanding of ElasticSearch 7.x document structure
  • Familiarity with Lucene indexing mechanisms
  • Knowledge of data types in ElasticSearch
  • Basic concepts of inverted indexes
NEXT STEPS
  • Explore ElasticSearch 7.x field mapping and data types
  • Learn about Lucene's indexing architecture and field management
  • Investigate best practices for structuring ElasticSearch indices
  • Review case studies on document type removal in ElasticSearch
USEFUL FOR

Developers, data architects, and system administrators working with ElasticSearch who need to understand the implications of document type removal and field type management.

shivajikobardan
Messages
637
Reaction score
54
The answer is this-:
Because we can't declare a field of different data types within a same index in different document types.

Say there's an index called "college".
Then there are document types called "student" "teacher" "administration" "staff".
What problem would occur if we allow this?

Books and documentations are saying that if a field called "date_of_join" is given a "text" data type in "student", then we can't give "date_of_join" as "date" data type in "staff".

It says that it's due to the way Lucene is.

This is because of the way Lucene maintains the field types in an index. As Lucene manages fields on an index level, there is no flexibility to declare two fields of different data types in the same index

But this is not clear without an example(of how lucene is storing index). Can you guys clarify this?
I know that lucene stores inverted indexes though. But still I'm not clear.
 
Technology news on Phys.org
Thread closed temporarily for Moderation...
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 18 ·
Replies
18
Views
6K
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
Replies
10
Views
5K
  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 6 ·
Replies
6
Views
22K