Forum Discussion

arthur_'s avatar
arthur_
Guide
7 years ago

Number of posts inside category or board

Hi,

 

We are trying to extract the number of messages inside board/category on CategoryPage.NodeList page using the following queries:

 

SELECT messages.count(*) FROM boards WHERE id = 'board_ID'
SELECT messages.count(*) FROM categories WHERE id = 'messages_ID'

 

If we compare numbers seen in native component's cards on CategoryPage.NodeList pages, for some categories/boards those numbers are matching when compared with those from API call, but for some there are differences.

 

In addition, there are some boards that on CategoryPage.NodeList pages show that they contain some messages, but are actually empty inside. When pulled through API call, value for number is returned correctly (shows zero posts), while native component show that something is inside.

 

Everything was run with administrator privileges (access should not been restricted).

 

I would appreciate an advice on what might cause those differences.

 

  • arthur_-

     

    If the native components show there is something inside when its empty actually, it is due to cache or indexing issue.

    You need to clear cache and check, if this doesn't solve the issue, open a ticket with lithium support for clear the cache and re-index the board data.

     

     

     

     

  • arthur_ -

    Could you please try to count messages for boards with API V1 also and confirm if you are getting same result (zero for some boards) 

    • arthur_'s avatar
      arthur_
      Guide

      TariqHussain Thank you very much for the suggestion.

       

      Tried to use API V1 using the following queries

       

      /restapi/vc/boards/id/board_ID/messages/count
      /restapi/vc/categories/id/category_ID/posts/count

       

      If API V2 call returned 0 for board in question, API V1 call returned the same value as native CategoryPage.NodeList component showing that something is inside (although that board is empty).

       

      API V1 call returned the same value as API V2 call when applied to categories, but unfortunately in both cases the value didn't match the native component.

      • arthur_-

         

        If the native components show there is something inside when its empty actually, it is due to cache or indexing issue.

        You need to clear cache and check, if this doesn't solve the issue, open a ticket with lithium support for clear the cache and re-index the board data.