index = None
def open(self, analyzer=None, threads=4):
- if ReusableIndex.index is not None:
+ if ReusableIndex.index:
self.index = ReusableIndex.index
else:
print("opening index")
@staticmethod
def close_reusable():
- if ReusableIndex.index is not None:
+ if ReusableIndex.index:
+ print("closing index")
ReusableIndex.index.optimize()
ReusableIndex.index.close()
ReusableIndex.index = None
def close(self):
- pass
+ if ReusableIndex.index:
+ ReusableIndex.index.commit()
class JoinSearch(object):