Forum Discussion

Gursimrat's avatar
Gursimrat
Leader
11 years ago

Using Endpoints and criteria for the recent messages in API results?

Hi, can anyone put some light on the recency criteria that the Lithium REST API returns the results?

 

Scenario: We are going implement the federated search on our forums, and we will be serving the data from the SOLR database, so we will be sending the query parameter from Lithium in an Endpoint to SOLR and in return, we will get a response from SOLR in REST format and get the result querying the data using Endpoints and display it on our community. 

 

Above is the obviously the second step, so we have a concern here, i.e. while serving the data to SOLR using below Lithium REST API,

 

community.lithium.com/community-name/restapi/vc/threads/id/[id] /replies/recent 

 

What is the criteria that lithium has for the recency, i mean the results which are served in the response, what is the timeline for that? Is it configurable? 

 

Thanks

 

3 Replies

  • HaidongG's avatar
    HaidongG
    Lithium Alumni (Retired)
    11 years ago

    Hi Gursimrat,

     

    As I know, "/recent" means to sort the messages in date/time descending order. 

     

    in additional, messages are paged in default, you may want to use "page" and "page_size" to limit your query, e.g. "recent?page_size=30&page=1".

     

    Best Regards

    /H

  • Gursimrat's avatar
    Gursimrat
    Leader
    11 years ago
    Hi HaidongG,

    Thanks, but using the page_size, we could miss any recent data that is, let say any discussion that was posted recently but was not in fetched in last 30 pages because, e.g. we had 310 discussions created in last 15 minutes and in last 30 pages, for 15 minutes, with page_size 10, we would only be fetching 300 discussions, and miss the 10, and then in next 15 minutes, lets say when we have 100 more discussions created, so in next cycle, our crawler will crawl 100 new + 10 of those discussions which were missed earlier, and 190 of the 300 crawled earlier. So, we don't want to fetch them based on page size, but rather include all the discussions that were created recently, so we don't re-crawl the same data again and again. So that is why we were concerned about the time lithium considers as recent so we can query the data based on its post date and time.