Using SymQL to retrieve associated section entry counts
This is an open discussion with 2 replies, filed under Extensions.
Search
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.
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?