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

In summary, the conversation discusses the issue of declaring fields of different data types within the same index in different document types. It is explained that this is not possible due to the way Lucene manages fields on an index level. This is because Lucene stores inverted indexes and there is no flexibility to declare two fields of different data types in the same index. The conversation ends with a request for further clarification on how Lucene stores indexes.
  • #1
shivajikobardan
674
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
  • #2
Thread closed temporarily for Moderation...
 

1. Why did you remove multiple document types within an index in ElasticSearch?

The removal of multiple document types within an index in ElasticSearch was necessary due to changes in the underlying data structures. This decision was made to improve performance and simplify the codebase.

2. Will this change affect my existing data in ElasticSearch?

Yes, the removal of multiple document types within an index in ElasticSearch will affect existing data. You will need to reindex your data to conform to the new single document type structure. However, there are tools and resources available to assist with this process.

3. How will this impact my query and indexing processes?

The removal of multiple document types within an index in ElasticSearch should not significantly impact your query and indexing processes. In fact, it may even improve performance as the new single document type structure is more efficient and streamlined.

4. Can I still have different document types within the same index?

No, with this change, only one document type is allowed per index in ElasticSearch. If you require different document types, you will need to create separate indices for each type.

5. Are there any alternatives to using multiple document types within an index?

Yes, instead of using multiple document types within an index, you can use a single document type with different fields to differentiate between document types. Alternatively, you can use multiple indices to store different types of documents.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
8
Views
909
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
Replies
6
Views
1K
  • Programming and Computer Science
Replies
1
Views
986
  • Programming and Computer Science
Replies
4
Views
4K
  • Programming and Computer Science
Replies
5
Views
820
  • Engineering and Comp Sci Homework Help
Replies
3
Views
2K
  • High Energy, Nuclear, Particle Physics
Replies
24
Views
2K
Replies
7
Views
1K
Back
Top