Hi,
For indexing my data, I have created a schema as
{
schema,
[
{version, "1.0"},
{default_field, "fname"},
{default_op, "or"},
{n_val, 3},
{analyzer_factory, {erlang, text_analyzers,
whitespace_analyzer_factory}}
],
[
%% Parse the field in preparation for full-text searching.
{field, [
{name, "fname"},
{required, true},
{analyzer_factory, {erlang, text_analyzers,
standard_analyzer_factory}}
]},
%% Treat the field as a date, which currently uses
noop_analyzer_factory.
{field, [
{name, "lname"},
{analyzer_factory, {erlang, text_analyzers,
standard_analyzer_factory}}
]},
%% A dynamic field. Catches any remaining fields in the
%% document, and uses the analyzer_factory setting defined
%% above for the schema.
{dynamic_field, [
{name, "*"}
]}
]
}.
and I have stored it in a file user_schema.
Then, I set the schema using command:
bin/search-cmd set_schema "testindex" user_schema
and when i use bin/search-cmd show_schema "testindex" it displays my schema
now when I try to use this index name for indexing my document as :
search:index_doc(<<"testindex">>, <<"my_doc">>, [{<<"fname">>, <<"Fname">>},
{<<"lname">>, <<"Lname">>}])
it gives me this error:
** exception error: bad argument
in function ets:lookup/2
called as ets:lookup(schema_table,<<"testUser">>)
in call from riak_search_config:get_schema/1
in call from riak_indexed_doc:new/4
in call from search:index_doc/4
and when i check ets:all() i don't see schema_table in the list??
So, am i missing something to store the schema or am i doing something
wrong???
//Wilson
_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com