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 = $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 <brain...@brainbuz.org <mailto:brain...@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 = handle_stupid_resultset(data); WHILE (x = 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@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.uk/
Dev site: http://dev.catalyst.perl.org/

_______________________________________________
List: Catalyst@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.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to