go-ego / riot

Go Open Source, Distributed, Simple and efficient Search Engine; Warning: This is V1 and beta version, because of big memory consume, and the V2 will be rewrite all code.
Apache License 2.0
6.11k stars 473 forks source link

when to use flush()? #67

Open jiankuny-zz opened 5 years ago

jiankuny-zz commented 5 years ago

should i user a timer to timely refresh the cache into index? i see there is a addCache and removeCache which default size is 300000, does it mean only when data size in cache large than 300000, will it add data into index?

vcaesar commented 5 years ago

You only need to call flush() once after the index, you can do other operations.

jiankuny-zz commented 5 years ago

so there is no way to timely flush cache into index? the only way is set the cache size smaller enough? because i want to dynamically add data into index