Example of Lucene 3.0.0 parsing (5)-indexfiles. Java

Source: Internet
Author: User

Previously, I talked about the process of adding a term to the posting table. Next I will talk about the process of writing the posting table to a file.

I am not very careful with this content. I will try to extend it in detail later.FootprintsHere

Preparations:

These six steps are preparations before writing. When indexwriter is called. after the close () process, the write starts. 6th) Step 1 is to create a segment index. The next step is:

This ordered call makes the posting tables in multiple threads and documents merged. These methods are very important. Please read them in detail, this layer-by-layer calling relationship is similar to Google map. From the perspective of the universe, you can see nothing clearly. To know the details, you have to go deep into the street level and give a book to you, if you only see the cover, you cannot write your reading experience. You can open it one page at a time.

The figure above shows this process. It makes sense to open every page and write the data. I will not draw any picture and directly copy the Lucene comment:

Current writer chain:

 
Formatpostingsfieldsconsumer

-> Impl: formatpostingsfieldswriter

 
-> Formatpostingstermsconsumer

-> Impl: formatpostingstermswriter

 
-> Formatpostingsdocconsumer

-> Impl: formatpostingsdocwriter

 
-> Formatpostingspositionsconsumer

-> Impl: formatpostingspositionswriter

Here is the class that is really responsible for writing. initialize and call the method in 10). You can read it in depth.

(This section is relatively hasty, and I hope to improve it later)

Next, I will explain how to retrieve files.

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.