missing_field error using riaksearch

Morten Siebuhr sbhr at sbhr.dk
Wed Mar 9 09:27:21 EST 2011

Hi all,

I'm trying to use Riak + Riaksearch as a datastore for Portable
Contacts [1], but I'm running into a spot of trouble making riaksearch
actually work;

I've set up riaksearch with the following schema document:

		{version, "0.1"}, {default_field, "_owner"}, {n_val, 1}
		%% Don't parse _id and _owner, just treat it as single token
		{field, [	{name, "id"},
				{required, true},
				{analyzer_factory, {erlang, text_analyzers, noop_analyzer_factory}}
		{field, [	{name, "_owner"},
				{required, true},
				{analyzer_factory, {erlang, text_analyzers, noop_analyzer_factory}}
		%% Parse Name fields for full-text indexing
		{field, [	{name, "displayName"},
				{aliases, ["nickname", "preferredUsername", "name_formatted",
				{analyzer_factory, {erlang, text_analyzers, standard_analyzer_factory}}
		{field, [	{name, "emails_value"},
				{analyzer_factory, {erlang, text_analyzers, standard_analyzer_factory}}

		%% Add modification dates
		{field, [	{name, "published"},
				{aliases, ["updated"]},
				{type, date}

(Edited slightly for shortness...)

I then add it using
> sudo sudo search-cmd set_schema PortableContacts `pwd`/pocolib/drivers/riak-search/schema.erl

And enable it on the 'PortableContacts' bucket:
> sudo search-cmd install PortableContacts

(BTW: It is not entirely clear from
https://wiki.basho.com/Riak-Search---Schema.html if the schema name
must match the bucket it should work for. At least, I'm not entirely

But when I then try to push a contact entry, it coughs up an 500
Internal Server Error:

curl -v -d '{"organizations": [{"name": "nickels principles", "title":
"curvier floppies"}], "displayName": "reverberating agrarian clue",
"name": {"givenName": "reverberating", "formatted": "reverberating
agrarian clue", "familyName": "agrarian clue"}, "emails": [{"value":
"shortcut at example.com"}], "_owner": "msi at one.com", "published":
"2010-04-26T13:10:33Z", "id": "48cad5d0-f057-4316-905e-281d1da32a01"}'
-H "Content-Type: application/json"
* About to connect() to localhost port 8098 (#0)
*   Trying ::1... Connection refused
*   Trying connected
* Connected to localhost ( port 8098 (#0)
> POST /riak/PortableContacts/48cad5d0-f057-4316-905e-281d1da32a01 HTTP/1.1
> User-Agent: curl/7.19.7 (i486-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/ libidn/1.15
> Host: localhost:8098
> Accept: */*
> Content-Type: application/json
> Content-Length: 396
< HTTP/1.1 500 Internal Server Error
< Vary: Accept-Encoding
< Server: MochiWeb/1.1 WebMachine/1.7.3 (participate in the frantic)
< Date: Wed, 09 Mar 2011 13:51:50 GMT
< Content-Type: text/html
< Content-Length: 749
<html><head><title>500 Internal Server
Error</title></head><body><h1>Internal Server Error</h1>The server
encountered an error while processing this
* Connection #0 to host localhost left intact
* Closing connection #0
web server</ADDRESS></body></html>

Any ideas as to where I'm doing something wrong?

I'm using version 0.14.0-1 of both products on Ubuntu 10.4 x86.

[1] http://portablecontacts.net/draft-spec.html

Morten Siebuhr

More information about the riak-users mailing list