[Catalyst] Working a Solr Model -- Follow Up
John Karr
brainbuz at brainbuz.org
Mon Oct 7 05:37:25 GMT 2013
More important than the ugly code to get output to display is that I =
couldn't figure out how to use a necessary solr feature. Equivalent to a =
DBD for a SQL database that doesn't support subqueries in a select.
Unfortunately, not all of my unicode woes have not been resolved, I have =
a description field that is causing IO::Handle to throw a wide character =
error on template rendering, and a bug reported for WebService::Solr =
since there does after all appear to be a real unicode issue.
As a workaround I wrote a macro in Template::Toolkit.
[% MACRO utfclean(field) PERL %]
use utf8;
my $field =3D $stash->get('field');
utf8::encode($field);
print $field ;
[% END %]
On 10/06/2013 05:57 AM, Kieren Diment wrote:
>
> On 06/10/2013, at 6:27 PM, John Karr <brainbuz at brainbuz.org =
> <mailto:brainbuz at brainbuz.org>> wrote:
>
>> Rejected: Apache::Solr
>> Returned a resultset that didn't work in Template::Toolkit, had write =
>> ugly code to convert to array of hashrefs.
>> I could not figure out how to use a filter query (they are absolutely =
>> required for how I intend to use Solr).
>
> Probably could have sorted this by passing the Solr resultset to a =
> subref set to $c->stash. so you end up with something like [% SET =
> data =3D handle_stupid_resultset(data); WHILE (x =3D data.iterate); 'do =
> stuff with ' _ x ; END; %] in your template. It's the poor man's =
> approach to putting new object models in the template rendering engine.
>
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.u=
k/
> Dev site: http://dev.catalyst.perl.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20131007/a7a10=
838/attachment.htm
More information about the Catalyst
mailing list