Navigation Menu

Skip to content

Commit

Permalink
ii: disable ".*" index search support by default
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Apr 12, 2017
1 parent 3b0eea8 commit dcccdeb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 15 additions & 1 deletion lib/ii.c
Expand Up @@ -101,6 +101,7 @@ static grn_bool grn_ii_overlap_token_skip_enable = GRN_FALSE;
static uint32_t grn_ii_builder_block_threshold_force = 0;
static uint32_t grn_ii_max_n_segments_small = MAX_PSEG_SMALL;
static uint32_t grn_ii_max_n_chunks_small = GRN_II_MAX_CHUNK_SMALL;
static grn_bool grn_ii_regexp_dot_asterisk_enable = GRN_FALSE;

void
grn_ii_init_from_env(void)
Expand Down Expand Up @@ -200,6 +201,18 @@ grn_ii_init_from_env(void)
}
}
}

{
char grn_ii_regexp_dot_asterisk_enable_env[GRN_ENV_BUFFER_SIZE];
grn_getenv("GRN_II_REGEXP_DOT_ASTERISK_ENABLE",
grn_ii_regexp_dot_asterisk_enable_env,
GRN_ENV_BUFFER_SIZE);
if (strcmp(grn_ii_regexp_dot_asterisk_enable_env, "yes") == 0) {
grn_ii_regexp_dot_asterisk_enable = GRN_TRUE;
} else {
grn_ii_regexp_dot_asterisk_enable = GRN_FALSE;
}
}
}

void
Expand Down Expand Up @@ -8029,7 +8042,8 @@ grn_ii_parse_regexp_query(grn_ctx *ctx,
if (*target == '\\') {
escaping = GRN_TRUE;
continue;
} else if (*target == '.' &&
} else if (grn_ii_regexp_dot_asterisk_enable &&
*target == '.' &&
grn_charlen(ctx, current, string_end) == 1 &&
*current == '*') {
if (GRN_TEXT_LEN(&buffer) > 0) {
Expand Down
@@ -1,3 +1,5 @@
#$GRN_II_REGEXP_DOT_ASTERISK_ENABLE=yes

table_create Memos TABLE_NO_KEY
column_create Memos content COLUMN_SCALAR Text

Expand Down

0 comments on commit dcccdeb

Please sign in to comment.