How Lucene understands how the document's & document type (TYPES) is implemented

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.