not able to create schema

wilson Tuladhar mailwilson007 at
Wed Feb 23 05:47:19 EST 2011


For indexing my data, I have created a schema as

        {version, "1.0"},
        {default_field, "fname"},
        {default_op, "or"},
        {n_val, 3},
        {analyzer_factory, {erlang, text_analyzers,
        %% Parse the field in preparation for full-text searching.
        {field, [
            {name, "fname"},
            {required, true},
            {analyzer_factory, {erlang, text_analyzers,

        %% Treat the field as a date, which currently uses
        {field, [
            {name, "lname"},
            {analyzer_factory, {erlang, text_analyzers,

        %% 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the riak-users mailing list