Once the index is, there are many ways in which you can improve
query resolution time. First of all, an index can be read from disk,
memory-mapped, or directly loaded into main memory. These three solutions
work with increasing speed and increased main memory usage. The default is
to read an index from disk, but you can add suitable options to the index
URI (e.g., mapped=1
or
inmemory=1
―see the Index.UriKeys
documentation) to force your preferences. Analogously,
offsets are necessary to locate, inside the index
file, the posting list of a certain term. By default they are read from
disk using a SemiExternalOffsetList
, but you can
load them in memory if you prefer so.
To get more options, you can partition your index. Once you have a cluster formed by several sub-indices, you can decide which sub-indices go to memory, which will be mapped, and so on.