The –elastic feature

New in Dezi 0.2.10 is the --elastic feature. This option is shorthand for:

 engine_config => {
   indexer_config => {
     config => {
       UndefinedMetaTags => 'autoall',
     }
   }
 }

But instead of all that, just pass the --elastic option when you start the server:

% dezi --elastic

The --elastic feature makes your Dezi server act like Elasticsearch: fields are created simply by adding a document that contains them. So when you do this:

$ curl -XPOST 'http://localhost:5000/index/blog/post/1' -d '
{ 
    "user": "dilbert", 
    "postDate": "2011-12-15", 
    "body": "Search is hard. Search should be easy." ,
    "title": "On search"
}' -H 'Content-Type: application/json'

the fields for user and postdate spring into existence.

Note that all field names are lowercased, so postDate becomes postdate.

Note also that there are some reserved field names, so title is not added as a field because the title field is already aliased to swishtitle. Likewise, body is aliased to swishdescription.

The elastic feature requires the following supporting modules:

  • SWISH::3 1.000006
  • SWISH::Prog::Lucy 0.17