err checking the searcher create
This commit is contained in:
parent
59e5545d70
commit
c1616fbca3
|
|
@ -59,7 +59,11 @@ end
|
||||||
-- create the searcher based on the cache-policy
|
-- create the searcher based on the cache-policy
|
||||||
local searcher, v_index, content
|
local searcher, v_index, content
|
||||||
if cachePolicy == "file" then
|
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
|
elseif cachePolicy == "vectorIndex" then
|
||||||
v_index = xdb.load_vector_index(dbFile)
|
v_index = xdb.load_vector_index(dbFile)
|
||||||
if v_index == nil then
|
if v_index == nil then
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue