# 索引文件的生成（六）之tim&&tip

## 生成一个或多个NodeBlock的流程图

### PendingEntry集合

xxxxxxxxxx

1

1

    private final List<PendingEntry> pending = new ArrayList<>();

### 生成一个或者多个PendingBlock到newBlock中

#### 为什么可能会生成多个PendingBlock

xxxxxxxxxx

1

1

The count is too large for one block, so we must break it into "floor" blocks, where we record the leading label of the suffix of the first term in each floor block, so at search time we can jump to the right floor block.  We just use a naive greedy segmenter here: make a new floor block as soon as we have at least minItemsInBlock.  This is not always best: it often produces a too-small block as the final block:

• 问题一：划分出一个floor block的规则是什么

#### 问题一：划分出一个floor block的规则是什么

• minItemsInBlock：默认值为25
• maxItemsInBlock：默认值为48，它的值可以设定的范围如下所示：

xxxxxxxxxx

1

1

minItemsInBlock < maxItemsInBlock < 2*(minItemsInBlock-1)

• isFloor：是否为floor block

#### block中至少包含PendingBlock

xxxxxxxxxx

1

1

    private final List<PendingBlock> newBlocks = new ArrayList<>();

• fp
• hasTerms