I’ve used the wonderful SymQL-based search example to construct the search for my new site, but I’ve come across a small issue: it doesn’t retrieve the associated section entry counts (for example the number of comments associated with the current entry via a section link).

Is there a simple way to make this work that I’m missing?

it doesn’t retrieve the associated section entry counts

This was deliberate since these counts are a big hog of query counts — in 2.0.7+ they are now optional in Data Sources (default to Off). SymQL doesn’t offer any way of adding these, sorry.

If you don’t want to delve into SymQL itself, you could iterate over each result from the SymQL query and perform the count yourself. You can create a count like this:

$query->select('system:count')->from('comments')->where('article', 123);

While I can see system:count in the SymQL source, I don’t think I’ve ever actually used it properly so can’t remember whether it’s fully implemented…

Thanks, Nick. I had hoped it would be a quick switch I could flick. Given that these are search results of my posts, the number of comments for each entry is probably not of great import.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details