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

  • Thread starter Thread starter shivajikobardan
  • Start date Start date
  • Tags Tags
    Index Multiple
Click For Summary
The discussion centers on the limitations of declaring different data types for the same field across various document types within a single index in Lucene. Specifically, if an index named "college" contains document types like "student," "teacher," "administration," and "staff," a field such as "date_of_join" cannot have a "text" data type in one document type and a "date" data type in another. This restriction arises from Lucene's management of field types at the index level, which does not allow for flexibility in defining multiple data types for the same field. The conversation highlights the need for clearer examples to illustrate how Lucene's inverted indexing system operates, as the current explanation may not be sufficient for understanding these constraints. The thread has been temporarily closed for moderation.
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...
 
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

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