SearchServer icon indicating copy to clipboard operation
SearchServer copied to clipboard

记录一下config.json中data.bin的存储规则

Open Antinomy20001 opened this issue 6 years ago • 1 comments

读取data.bin的实现在FaissInterface.cppbool faissSearch::load里。

具体存储规则如下:

首先是5个int,只有前三个有意义,分别对应:数据维度(dimension),向量数量(count),fileFormatVersion,0,0

接下来为count组数据,每组数据的以一个int长度的id开头,然后是dim * sizeof(float)长度的数据表示向量数据。

Antinomy20001 avatar Sep 20 '19 09:09 Antinomy20001

The implementation of reading data.bin is in bool faissSearch::load , FaissInterface.cpp.

The storage rules are as follows:

The first is 5 ints, only the first three are meaningful, corresponding to: data dimension (dimension), number of vectors (count), fileFormatVersion, 0, 0.

Next is the count group data, each group of data begins with an id length id, and then dim * sizeof (float) length data represents vector data.

Antinomy20001 avatar Sep 20 '19 09:09 Antinomy20001