search schema caching bug?

Michael Radford mrad at blorf.com
Mon Apr 23 18:13:46 EDT 2012


In order to get case-insensitive indexing without stopwords, I'm
trying to put a new search schema in place using the method from the
Riak wiki:

search-cmd set-schema [bucket] [schema file]

This apparently succeeded, and search-cmd show-schema correctly
returns my new schema. However, I was still getting
stopword_not_allowed_in_query errors from searches. Looking at the
code, I saw that the schema for parsing queries comes from

    {ok, Schema} = riak_search_config:get_schema(IndexName),

and sure enough, riak_search_config:get_schema for my bucket returns
the old (default) schema. Looking at the source for that function, I
see the schema is cached locally in an ets table, and then when
search-cmd calls riak_search_config:put_raw_schema, it updates the
local cache, but it seems like the other nodes' caches are not
cleared. Is this a bug?

As a workaround, it seems I can call riak_search_config:clear() on all
the nodes after setting the new schema. (But if this is a bad idea for
some reason, I'd like to know before trying this on a production
system!)

Mike




More information about the riak-users mailing list