Navigation Menu

Skip to content

Commit

Permalink
schema: support tokenizer
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Oct 20, 2015
1 parent 21ec7e9 commit e0349be
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 6 deletions.
13 changes: 12 additions & 1 deletion lib/proc.c
Expand Up @@ -7530,6 +7530,14 @@ proc_schema_table_output_value_type(grn_ctx *ctx, grn_obj *table)
GRN_OUTPUT_MAP_CLOSE();
}

static void
proc_schema_table_output_tokenizer(grn_ctx *ctx, grn_obj *table)
{
grn_obj *tokenizer;
tokenizer = grn_obj_get_info(ctx, table, GRN_INFO_DEFAULT_TOKENIZER, NULL);
proc_schema_output_name(ctx, tokenizer);
}

static void
proc_schema_tables(grn_ctx *ctx)
{
Expand All @@ -7551,7 +7559,7 @@ proc_schema_tables(grn_ctx *ctx)

proc_schema_output_name(ctx, table);

GRN_OUTPUT_MAP_OPEN("table", 4);
GRN_OUTPUT_MAP_OPEN("table", 5);

GRN_OUTPUT_CSTR("name");
proc_schema_output_name(ctx, table);
Expand All @@ -7565,6 +7573,9 @@ proc_schema_tables(grn_ctx *ctx)
GRN_OUTPUT_CSTR("value_type");
proc_schema_table_output_value_type(ctx, table);

GRN_OUTPUT_CSTR("tokenizer");
proc_schema_table_output_tokenizer(ctx, table);

GRN_OUTPUT_MAP_CLOSE();
}
GRN_OUTPUT_MAP_CLOSE();
Expand Down
3 changes: 2 additions & 1 deletion test/command/suite/schema/tables/array.expected
Expand Up @@ -171,7 +171,8 @@ schema
"name": "Logs",
"type": "array",
"key_type": null,
"value_type": null
"value_type": null,
"tokenizer": null
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion test/command/suite/schema/tables/hash_table.expected
Expand Up @@ -174,7 +174,8 @@ schema
"name": "ShortText",
"type": "type"
},
"value_type": null
"value_type": null,
"tokenizer": null
}
}
}
Expand Down
Expand Up @@ -176,7 +176,8 @@ schema
"value_type": {
"name": "Users",
"type": "reference"
}
},
"tokenizer": null
},
"Users": {
"name": "Users",
Expand All @@ -185,7 +186,8 @@ schema
"name": "ShortText",
"type": "type"
},
"value_type": null
"value_type": null,
"tokenizer": null
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion test/command/suite/schema/tables/value_type/type.expected
Expand Up @@ -174,7 +174,8 @@ schema
"value_type": {
"name": "Int32",
"type": "type"
}
},
"tokenizer": null
}
}
}
Expand Down

0 comments on commit e0349be

Please sign in to comment.