Intro to Dezi

Peter Karman

https://svn.publicradio.org/sw/tech-talks/dezi-intro

0. Dezi

1. Perl search platform

2. REST Oriented

 GET      /search?q=foo    # return search results for 'foo'
 POST     /index/foo       # add or update document 'foo'
 PUT      /index/foo       # add (only) document 'foo'
 GET      /index/foo       # return document 'foo'
 DELETE   /index/foo       # remove document 'foo'
 COMMIT   /index           # write pending changes
 POST     /commit          # same as COMMIT /index
 ROLLBACK /index           # abort pending changes
 POST     /rollback        # same as ROLLBACK /index
 GET      /ui              # return Dezi::UI HTML
     

3. A.K.A. Swish3 web service

4. JSON

% curl -XPOST http://localhost:5000/foo \
  -d '<doc><title>bar<title>foo</doc>' \
  -H 'Content-Type: application/xml' 

{"success":1,"build_time":"1.20023","total":1,"code":"202"}

% curl -XPOST http://localhost:5000/index/bar \
   -d '{"title":"ima json doc","body":"hear me roar"}' \
   -H 'Content-Type: application/json'

{"success":1,"build_time":"0.01309","total":1,"code":"202"}

% curl -XCOMMIT http://localhost:5000/index

{"success":1,"build_time":"0.09501","total":2,"code":"200"}

5. SPORE

Discoverable REST spec
% curl http://localhost:5000/ | json_xs

{
   "api_base_url" : "http://localhost:5000",
   "api_format" : [
      "JSON",
      "ExtJS",
      "XML"
   ],
   // ...
   "description" : "This is a Dezi search server. See http://dezi.org/ for more details.",
}
    

6. More Docs

7. Examples