Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Prepare a sample schema

  • Loading branch information...
commit 9c0793761455feba91c92c54fbd2c30a61cf83a0 1 parent 5aad5c4
@michaelklishin authored
Showing with 27 additions and 0 deletions.
  1. +2 −0  bin/ci/before_script.sh
  2. +25 −0 test/resources/search/tweets/schema.erl
View
2  bin/ci/before_script.sh
@@ -0,0 +1,2 @@
+# this assumes Riak Search is enabled
+search-cmd set-schema tweets test/resources/search/tweets/schema.erl
View
25 test/resources/search/tweets/schema.erl
@@ -0,0 +1,25 @@
+%% an example used in Riak Handbook by Mathias Meyer
+{schema, [{version, "1.1"},
+ {n_val, 2},
+ {default_field, "field"},
+ {default_op, "or"},
+ {analyzer_factory, {erlang, text_analyzers, whitespace_analyzer_factory}}],
+ [{field, [{name, "id_str"},
+ {type, integer},
+ {required, true},
+ {padding, 19},
+ {analyzer_factory, {erlang, text_analyzers, integer_analyzer_factory}}]},
+ {field, [{name, "tweet"},
+ {type, string},
+ {required, true},
+ {analyzer_factory, {erlang, text_analyzers, standard_analyzer_factory}}]},
+ {field, [{name, "tweeted_at"},
+ {type, date},
+ {required, true},
+ {analyzer_factory, {erlang, text_analyzers, noop_analyzer_factory}}]},
+ {field, [{name, "user"},
+ {type, string},
+ {required, true},
+ {analyzer_factory, {erlang, text_analyzers, noop_analyzer_factory}} ]},
+ {dynamic_field, [{name, "*"}, {skip, true}]}
+ ]}.
Please sign in to comment.
Something went wrong with that request. Please try again.