Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Entity API = 7.x-1.0-beta9
Search API solr = 7.x-1.0-beta3
I have been playing around views Views integration and the Search API and I am finding that the node count always maxes out at 10, regardless of the type of view I am creating.
Example: I created a view based on a taxonomy entity index. It is correctly pulling taxonomy terms into a view. If there are less than 10 nodes associated with that term, the node count is correct. If there are more than 10, node count always shows 10.
Note: I have also created facets, and they display the correct node count.
Comment | File | Size | Author |
---|---|---|---|
#7 | taxonomy_term_node-1196796-7.patch | 642 bytes | rafenden |
|
Comments
Comment #1
drunken monkeyWeird, but seems to be an Entity API problem. At least I couldn't imagine what could go wrong on the Search API end there.
Comment #2
fagoComment #3
ethnovode CreditAttribution: ethnovode commentedHello,
Is there a solution for this ? I'd like to display the top categories inside a view using search api solr.
Thanks.
Comment #4
ethnovode CreditAttribution: ethnovode commentedComment #5
colle901 CreditAttribution: colle901 commentedI think it can be fixed by changing the call on line 266 in entity/modules/callbacks.inc:
Change to:
The second parameter needs to be FALSE, otherwise paging kicks in (hence the result of 10). The fourth parameter can be set to an empty array since sorting is not necessary for the count.
Comment #6
afranioce CreditAttribution: afranioce commentedcomment #5 resolve this problem
Comment #7
rafenden CreditAttribution: rafenden at EndCode Ltd commentedHere is the patch.
Comment #8
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedThe 2 year old patch in #7 to callbacks.inc applied cleanly to the latest entity 7.x-1.x-dev and (if still relevant) needs review.