err checking the searcher create

This commit is contained in:
Lion 2022-07-02 17:58:15 +08:00
parent 83707692e1
commit 9e8f672b9a
1 changed files with 5 additions and 1 deletions

View File

@ -59,7 +59,11 @@ end
-- create the searcher based on the cache-policy
local searcher, v_index, content
if cachePolicy == "file" then
searcher = xdb.new_with_file_only(dbFile)
searcher, err = xdb.new_with_file_only(dbFile)
if err ~= nil then
print(string.format("failed to create searcher: %s", err))
return
end
elseif cachePolicy == "vectorIndex" then
v_index = xdb.load_vector_index(dbFile)
if v_index == nil then