Skip to main content

How to set up your own PerlMongers web service in 10 minutes or less

·273 words·2 mins·
CPAN Elasticsearch metacpan perl Perl Mongers REST
Table of Contents
❤️ It's great to see you here! I'm currently available on evenings and weekends for consulting and freelance work. Let's chat about how I can help you achieve your goals.

I've been working with ElasticSearch over the past months as part of the MetaCPAN project. Using ElasticSearch as our back end has worked out really well so far. The reason is that, out of the box, it provides a REST API. So, in our case, we've been able to concentrate on writing code and not on designing an API, defining its behaviour, arguing over URL schemes etc.

To be clear, ES is not written in Perl, but there is a handy Perl module you can use to get yourself up and running in *minutes*.

Comments
#

Author: Clinton Gormley

Date: 02/11/2011 11:03:44 AM

Hi Oalders

nice post!

One question: why do you encode to UTF8? That should be handled by ElasticSearch.pm. Did you see any issues with encoding? I tried deleting that block and rerunning the script, and the encoding seems fine.

ta

Clint


Author: Olaf Alders

Date: 02/11/2011 12:44:02 PM

Hi Clinton,

I’ve put up a gist with the error: https://gist.github.com/822286. It went away after I handled the encoding, but from the error message, I really couldn’t tell exactly what the issue was.

Thanks,

Olaf


Author: Clinton Gormley

Date: 02/11/2011 02:48:51 PM

Hmmm,that’s weird. Especially as that particular entry has only ASCII characters.

What’s the error you get in the elasticsearch log?

I wonder if this is a version thing - what version of Perl , XML::Simple, WWW::Mechanize and WWW::Mechanize::Cached are you using?

clint


Author: Olaf Alders

Date: 02/11/2011 03:52:29 PM

Hi Clint,

I’ve updated the Gist with the server errors. You are correct about the modules. When I switch from Mechanize::Cached to Mechanize, I no longer need to encode. Weird.

Olaf


Related

search.metacpan.org: Building a Sexier CPAN Search
·1534 words·8 mins
CPAN Elasticsearch perl
iCPAN v1.0.2 is Now in Apple's App Store
·398 words·2 mins
CPAN iPhone Objective-C perl
Using Plack to Like a Module on Facebook
·274 words·2 mins
CPAN Facebook HTML::Highlighter perl Plack