Created
December 20, 2012 23:42
-
-
Save igorgue/4349616 to your computer and use it in GitHub Desktop.
Riak search schema for my bucket, it's the default and I always store JSON data.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% Schema for 'objects' | |
{ | |
schema, | |
[ | |
{version, "1.1"}, | |
{n_val, 3}, | |
{default_field, "value"}, | |
{analyzer_factory, {erlang, text_analyzers, whitespace_analyzer_factory}} | |
], | |
[ | |
%% Field names ending in "_num" are indexed as integers | |
{dynamic_field, [ | |
{name, "*_num"}, | |
{type, integer}, | |
{analyzer_factory, {erlang, text_analyzers, integer_analyzer_factory}} | |
]}, | |
%% Field names ending in "_int" are indexed as integers | |
{dynamic_field, [ | |
{name, "*_int"}, | |
{type, integer}, | |
{analyzer_factory, {erlang, text_analyzers, integer_analyzer_factory}} | |
]}, | |
%% Field names ending in "_dt" are indexed as dates | |
{dynamic_field, [ | |
{name, "*_dt"}, | |
{type, date}, | |
{analyzer_factory, {erlang, text_analyzers, noop_analyzer_factory}} | |
]}, | |
%% Field names ending in "_date" are indexed as dates | |
{dynamic_field, [ | |
{name, "*_date"}, | |
{type, date}, | |
{analyzer_factory, {erlang, text_analyzers, noop_analyzer_factory}} | |
]}, | |
%% Field names ending in "_txt" are indexed as full text" | |
{dynamic_field, [ | |
{name, "*_txt"}, | |
{type, string}, | |
{analyzer_factory, {erlang, text_analyzers, standard_analyzer_factory}} | |
]}, | |
%% Field names ending in "_text" are indexed as full text" | |
{dynamic_field, [ | |
{name, "*_text"}, | |
{type, string}, | |
{analyzer_factory, {erlang, text_analyzers, standard_analyzer_factory}} | |
]}, | |
%% Everything else is a string | |
{dynamic_field, [ | |
{name, "*"}, | |
{type, string}, | |
{analyzer_factory, {erlang, text_analyzers, whitespace_analyzer_factory}} | |
]} | |
] | |
}. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment