Riak Search 2 not indexing bucket
<p>I'm using Riak as a key-value store backend for a graph database implemented in Python.</p>

<p>I created a custom <a href="https://github.com/linkdd/link.graph/blob/master/etc/link/graph/schemas/node.xml" rel="nofollow">search schema</a> named <code>nodes</code>.
I created and activated a bucket type <code>nodes</code> with the <code>search_index</code> property set to <code>nodes</code> and the <code>datatype</code> property set to <code>map</code>.</p>

<p>I inserted the following data into the bucket <code>default</code> (with bucket type <code>nodes</code>):</p>

<pre><code>key: node1
value: {
    "type_set": {"n1"},
    "foo_set": {"bar", "baz"}
}
</code></pre>

<p><strong>NB:</strong> the data is automatically transformed into a Map datatype.</p>

<p>I can fetch the data correctly, but I tried the following fulltext searches and no document is returned:</p>

<pre><code>type_set:n1
type_set:*n1*
type_set:*
foo_set:*
_yz_rk:node1
_yz_rk:*
</code></pre>

<p>It seems that my document is not indexed.</p>

<p>I also tried to set the <code>search_type</code> property to <code>nodes</code> on the bucket <code>default</code>, but I got the same result.</p>

<p>The parameter <code>search</code> is set to <code>on</code> in the configuration file (<code>/etc/riak/riak.conf</code>) and the OpenJDK 7 is installed.</p>

<p>I have no idea what I'm doing wrong, if anyone can help me, thanks in advance.</p>

<p>First, you should take into account that Riak automatically adds suffix <code>_set</code>, so that you don't have to name yours <code>type_set</code> but <code>type</code>. Otherwise you will have to query for <code>type_set_set:*</code> instead of <code>type_set:*</code>.</p>

<p>Second, according to <a href="https://docs.basho.com/riak/kv/2.0.0/developing/usage/searching-data-types/#data-type-schemas" rel="nofollow">Data Type Schemas</a>, embedded schemas (as opposed to top-level ones) must use dynamic fields. Apparently Riak prepends field names with some internal identifier of the top-level map. Unfortunately, this also means that you cannot index one set without indexing the other as well.</p>

<p>I've run some tests and found out that <code>&lt;dynamicField name="*_set" type="string" indexed="true" stored="true" multiValued="true"/&gt;</code> works fine, while <code>&lt;dynamicField name="*type_set" type="string" indexed="true" stored="true" multiValued="true"/&gt;</code> does not.</p>

python solr riak