How Lucene understands the document
In Lucene, a document is made up of a series of simple field-value (field-value) pairs. A field must have a value, while allowing multiple values to be included. Similarly, a single string may be converted to more than one value during the parsing process. Lucene does not care whether a value is a string, a number, or a date-all values are treated with an incomprehensible bit value (opaque).
When we index a document in Lucene, values and fields are associated in the reverse index (inverted index). Optionally, if the original value is stored for future use, the stored value is immutable.
How the document type (TYPES) is implemented
The type of elasticsearch is implemented on a simple infrastructure. There may be multiple types of an index, each of which has its own mapping (schema of the type database). At the same time, each document under the same type is stored in the same index.
Because Lucene does not have the concept of a document type, the type name of the document is stored in a metadata called _type in the document. When we are searching for some type of document, Elasticsearch simply uses that type of value to filter on the _type field.
Lucene also has no concept of mapping. Mapping is a layer of elasticsearch that maps complex JSON documents to simple, flat documents that Lucene can handle.
How Lucene understands how the document's & document type (TYPES) is implemented