Skip to content

Commit

Permalink
enable search GC (#1194) (#1196)
Browse files Browse the repository at this point in the history
Co-authored-by: Roi Lipman <swilly22@users.noreply.github.com>
  • Loading branch information
DvirDukhan and swilly22 committed Jul 7, 2020
1 parent 179692f commit 4266818
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/index/index.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ void Index_Construct
RSIndexOptions *idx_options = RediSearch_CreateIndexOptions();
// TODO: Remove this comment when https://github.com/RediSearch/RediSearch/issues/1100 is closed
// RediSearch_IndexOptionsSetGetValueCallback(idx_options, _getNodeAttribute, gc);

// enable GC, every 30 seconds gc will check if there's garbage
// if there are over 100 docs to remove GC will perform clean up
RediSearch_IndexOptionsSetGCPolicy(idx_options, GC_POLICY_FORK);
rsIdx = RediSearch_CreateIndex(idx->label, idx_options);
RediSearch_FreeIndexOptions(idx_options);

Expand Down

0 comments on commit 4266818

Please sign in to comment.