Why did we remove multiple document types within an index in

Why did we remove multiple document types within an index in

Postby shivajikobardan » Tue Jul 19, 2022 5:07 am

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.
shivajikobardan
 
Posts: 29
Joined: Sat Jan 08, 2022 2:13 pm
Reputation: 1

Return to Programming and Algorithms



Who is online

Users browsing this forum: No registered users and 5 guests

cron