/** * 初始化 全量index * * @param path 数据存放路径 * * @return 0: success ; -1: 程序处理失败 */ int initFullIndex(const char * path) { IndexReader * reader = IndexReader::getInstance(); if ( NULL == reader ) { TERR("IndexReader instance is null"); return -1; } if ( (NULL == path) || strlen( path ) <= 0 ) { TERR("index node's path attribute is null"); return -1; } TLOG("begin to load full index! path:%s", path); if ( reader->open( path ) < 0) { TERR("load full index failed! path:%s", path); return -1; } TLOG("load full index success!"); return 0; }