Skip to content
Browse files

Add unit tests for inline fields.

AZ825
  • Loading branch information...
1 parent bf28217 commit 07151bd28a9feeddeb699be6ebc584afbf3d4c2d @rustyio rustyio committed Oct 10, 2011
View
12 tests/riak_search/replication_test/script.def
@@ -63,8 +63,8 @@
{sleep, 1},
{echo, "Verify replication of index on dev2"},
- {search, 'dev2@127.0.0.1', "value:Baltimore", [{length, 2}]},
- {search, 'dev2@127.0.0.1', "value:Cambridge", [{length, 1}]},
+ {search_node, 'dev2@127.0.0.1', "value:Baltimore", [{length, 2}]},
+ {search_node, 'dev2@127.0.0.1', "value:Cambridge", [{length, 1}]},
{echo, "De-index KV objects"},
{delobj, <<"test">>, <<"v1">>},
@@ -78,8 +78,8 @@
{sleep, 1},
{echo, "Verify replication of de-indexing to dev2"},
- {search, 'dev2@127.0.0.1', "value:Baltimore", [{length, 0}]},
- {search, 'dev2@127.0.0.1', "value:Cambridge", [{length, 0}]},
+ {search_node, 'dev2@127.0.0.1', "value:Baltimore", [{length, 0}]},
+ {search_node, 'dev2@127.0.0.1', "value:Cambridge", [{length, 0}]},
{echo, "Index local documents"},
{index, "../_files/docs"},
@@ -89,7 +89,7 @@
{echo, "Verify repliction of index to dev2"},
{sleep, 1},
- {search, 'dev2@127.0.0.1', "value:brown", [{length, 1}]},
+ {search_node, 'dev2@127.0.0.1', "value:brown", [{length, 1}]},
{echo, "De-index local documents"},
{delete, "../_files/docs"},
@@ -99,7 +99,7 @@
{echo, "Verify replication of de-indexing to dev2"},
{sleep, 1},
- {search, 'dev2@127.0.0.1', "value:brown", [{length, 0}]},
+ {search_node, 'dev2@127.0.0.1', "value:brown", [{length, 0}]},
{echo, "Done"}
].
View
18 tests/riak_search/schema_test/schema.def
@@ -1,5 +1,5 @@
{
- schema,
+ schema,
[
{version, "1.1"},
{default_field, "value"},
@@ -52,22 +52,22 @@
{field, [
{name, "inline"},
{inline, true}
- ]},
+ ]},
- {dynamic_field, [
+ {dynamic_field, [
{name, "*_i"},
{type, integer},
{padding_size, 4}
]},
- {dynamic_field, [
+ {dynamic_field, [
{name, "*_sd"},
{type, string},
%% {analyzer_factory, "com.basho.search.analysis.StandardAnalyzerFactory"}
{analyzer_factory, {erlang, text_analyzers, standard_analyzer_factory}}
]},
- {dynamic_field, [
+ {dynamic_field, [
{name, "*_sw"},
{type, string},
%% {analyzer_factory, "com.basho.search.analysis.WhitespaceAnalyzerFactory"}
@@ -84,20 +84,20 @@
{inline, true}
]},
- {dynamic_field, [
+ {dynamic_field, [
{name, "i_*"},
{type, integer},
{padding_size, 4}
]},
- {dynamic_field, [
+ {dynamic_field, [
{name, "sd_*"},
{type, string},
%% {analyzer_factory, "com.basho.search.analysis.StandardAnalyzerFactory"}
{analyzer_factory, {erlang, text_analyzers, standard_analyzer_factory}}
]},
- {dynamic_field, [
+ {dynamic_field, [
{name, "sw_*"},
{type, string},
%% {analyzer_factory, "com.basho.search.analysis.WhitespaceAnalyzerFactory"}
@@ -131,7 +131,7 @@
{type, integer},
{padding_size, 4}
]},
-
+
% This field should be ignored.
{field, [
{name, "order2_int"},
View
41 tests/riak_search/schema_test/script.def
@@ -3,7 +3,7 @@
{schema, "schema.def"},
%% Index the solr in "0"...
- {echo, "Indexing documents..."},
+ {echo, "Indexing documents..."},
{solr, "./solr_add.xml"},
{echo, "Verify that we find all five documents containing 'one'."},
@@ -17,11 +17,11 @@
{search, "whitespace:million", [{length, 0}]},
{search, "whitespace:million,a", [{length, 1}]},
- %% {echo, "Verify inline fields."},
- %% {search, "key:one", [{property, <<"inline">>, <<"one">>}]},
- %% {search, "key:one AND inline:one", [{property, <<"inline">>, <<"one">>}]},
- %% {search, "key:twenty", [{property, <<"inline">>, <<"twenty">>}]},
- %% {search, "key:twenty AND inline:twenty", [{property, <<"inline">>, <<"twenty">>}]},
+ {echo, "Verify inline fields."},
+ {search, "key:one", [{property, <<"inline">>, <<"one">>}]},
+ {search, "key:one AND inline:one", [{property, <<"inline">>, <<"one">>}]},
+ {search, "key:twenty", [{property, <<"inline">>, <<"twenty">>}]},
+ {search, "key:twenty AND inline:twenty", [{property, <<"inline">>, <<"twenty">>}]},
{echo, "Verify dynamic string fields."},
{search, "dyn_sd:million", [{length, 1}]},
@@ -160,22 +160,25 @@
{search, "i_dyn:[20 TO '-01']", [{length, 4}]},
{search, "i_dyn:[0020 TO '-001']", [{length, 4}]},
- %% {echo, "Verify dynamic inline fields."},
- %% {search, "key:one", [{property, "dyn_inline", "one"}]},
- %% {search, "key:one AND dyn_inline:one", [{property, "dyn_inline", "one"}]},
- %% {search, "(key:one OR key:two) AND dyn_inline:one", [{property, "dyn_inline", "one"}]},
+ {echo, "Verify dynamic inline fields."},
+ {search, "key:one", [{property, <<"dyn_inline">>, <<"one">>}]},
+ {search, "key:one AND dyn_inline:one", [{property, <<"dyn_inline">>, <<"one">>}]},
+ {search, "(key:one OR key:two) AND dyn_inline:one", [{property, <<"dyn_inline">>, <<"one">>}]},
- %% {search, "key:twenty", [{property, "dyn_inline", "twenty"}]},
- %% {search, "key:twenty AND dyn_inline:twenty", [{property, "dyn_inline", "twenty"}]},
- %% {search, "(key:twenty OR key:hundred) AND dyn_inline:twenty", [{property, "dyn_inline", "twenty"}]},
+ {search, "key:twenty", [{property, <<"dyn_inline">>, <<"twenty">>}]},
+ {search, "key:twenty AND dyn_inline:twenty", [{property, <<"dyn_inline">>, <<"twenty">>}]},
+ {search, "(key:twenty OR key:hundred) AND dyn_inline:twenty", [{property, <<"dyn_inline">>, <<"twenty">>}]},
- %% {search, "key:one", [{property, "inline_dyn", "one"}]},
- %% {search, "key:one AND inline_dyn:one", [{property, "inline_dyn", "one"}]},
- %% {search, "(key:one OR key:two) AND inline_dyn:one", [{property, "inline_dyn", "one"}]},
+ {search, "key:one", [{property, <<"inline_dyn">>, <<"one">>}]},
+ {search, "key:one AND inline_dyn:one", [{property, <<"inline_dyn">>, <<"one">>}]},
+ {search, "(key:one OR key:two) AND inline_dyn:one", [{property, <<"inline_dyn">>, <<"one">>}]},
- %% {search, "key:twenty", [{property, "inline_dyn", "twenty"}]},
- %% {search, "key:twenty AND inline_dyn:twenty", [{property, "inline_dyn", "twenty"}]},
- %% {search, "(key:twenty OR key:hundred) AND inline_dyn:twenty", [{property, "inline_dyn", "twenty"}]},
+ {search, "key:twenty", [{property, <<"inline_dyn">>, <<"twenty">>}]},
+ {search, "key:twenty AND inline_dyn:twenty", [{property, <<"inline_dyn">>, <<"twenty">>}]},
+ {search, "(key:twenty OR key:hundred) AND inline_dyn:twenty", [{property, <<"inline_dyn">>, <<"twenty">>}]},
+
+ {search, "inline:one", "inline:one", [{length, 1}]},
+ {search, "inline:one", "inline:foo", [{length, 0}]},
{echo, "Verify field ordering."},
{search, "order1_int:1", [{length, 1}]},

0 comments on commit 07151bd

Please sign in to comment.
Something went wrong with that request. Please try again.