Navigation Menu

Skip to content

Commit

Permalink
highlighter: add grn_highlighter_clear_keywords()
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 7, 2018
1 parent 03fd924 commit 9dd7903
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/groonga/highlighter.h
Expand Up @@ -47,6 +47,9 @@ grn_highlighter_add_keyword(grn_ctx *ctx,
grn_highlighter *highlighter,
const char *keyword,
int64_t keyword_length);
GRN_API grn_rc
grn_highlighter_clear_keywords(grn_ctx *ctx,
grn_highlighter *highlighter);


#ifdef __cplusplus
Expand Down
15 changes: 15 additions & 0 deletions lib/highlighter.c
Expand Up @@ -802,3 +802,18 @@ grn_highlighter_add_keyword(grn_ctx *ctx,
exit :
GRN_API_RETURN(ctx->rc);
}

grn_rc
grn_highlighter_clear_keywords(grn_ctx *ctx,
grn_highlighter *highlighter)
{
grn_obj *raw_keywords = &(highlighter->raw_keywords);

GRN_API_ENTER;

GRN_BULK_REWIND(raw_keywords);
highlighter->need_prepared = GRN_TRUE;

exit :
GRN_API_RETURN(ctx->rc);
}

0 comments on commit 9dd7903

Please sign in to comment.