You are here: C++ API > Classes > dtsIndexJob Structure > dtsIndexJob::startingDocId Data Member
Close
dtSearch Text Retrieval Engine Programmer's Reference
dtsIndexJob::startingDocId Data Member

If non-zero, the first doc id to assign to documents in this index.

Syntax
C++
long startingDocId;

By default, the dtSearch indexer assigns each document a numerical id starting with 1 in each index. These ids are used in SearchFilters and in other places in the dtSearch Engine API to identify documents within an index. When an index is created, startingDocId can be used to specify that doc ids for the index should start with a value other than 1. This can be useful in situations where it is important that doc ids not change when indexes are merged. 

Each DocId value in an index requires one bit in a SearchFilter, so a SearchFilter for an index with DocIds ranging from 1 to 1,000,000 would require 125,000 bytes of memory. Note that this means there is a performance cost to using unnecessarily high values for startingDocId.

Copyright (c) 1995-2021 dtSearch Corp. All rights reserved.