10-20-2016 01:48 AM
We are trying to implement a recording fetching mechanism if missed due to any reason. We have date range and will fetch recordings between this. To make this more scalable I divided this date range into the interval of one day so We send a query for each day separately. But I'm not getting records more than 100. While in the documentation it's mentioned that its default value. So how may we increase this limit?
Currently, these are the request parameters we are sending:
{
"requestParameters": [
{
"fieldName" : "sessionStartDate",
"fieldConditions": [
{
"fieldOperator" : "between",
"fieldValues" : [
"1476817200000",
"1476900000000"
]
}]}]}
We tried by adding below attributes as well in the above parameters, but not worked still return max 100 records
,
"pageParameters": {"offset": "0" ,
"limit": "1000" }
And also tried this:
/queryService/query/getSessions?limit=1000
Would we have to further divide query (in 4 ,6 or 8 hours) ? What's THE BEST approach as mediasense also discards query if it takes more than 2 minutes (btw what is the maximum number of recordings which can be filtered in these 2 minutes with sessionStartDate constraint with between operator?)sessionStartDate
Thanks for your time and support.
anilve imandal nitinsi dlender manisgu3 pnijhawa hariskum anilv
Solved! Go to Solution.
10-21-2016 06:08 AM
Hi Bilal,
Due to performance issue we limit the results. If you want to get all sessions which fulfil your search criteria, you can make custom queries. These custom queries will return all session which fulfil your search criteria. For more information, go to below link.
https://developer.cisco.com/fileMedia/download/f0cd51b5-0ba6-494b-968c-9219cc3f4cc2
and search for section "Avoiding Non-Scalable Queries". In this section, there is information about custom queries and scalability.
For more queries/clarification, please revert back to us.
Regards,
Ambrose Dev
10-21-2016 06:08 AM
Hi Bilal,
Due to performance issue we limit the results. If you want to get all sessions which fulfil your search criteria, you can make custom queries. These custom queries will return all session which fulfil your search criteria. For more information, go to below link.
https://developer.cisco.com/fileMedia/download/f0cd51b5-0ba6-494b-968c-9219cc3f4cc2
and search for section "Avoiding Non-Scalable Queries". In this section, there is information about custom queries and scalability.
For more queries/clarification, please revert back to us.
Regards,
Ambrose Dev
10-21-2016 06:45 AM
Hi Ambrose,
Thanks for your reply.
We already reviewed this document. As mentioned in the description of this post, we are already using custom queries by specifying the range to be applied on sessionStartDate to fetch recordings. But the issue is that we aren't getting all recordings which are fulfilling our custom query. We are getting the maximum of 100 records while we want to get all the recordings which fulfills our query.
So, what's the possibility for us? Is this the limitation that we can't get more than 100 records at mediasense side or would we have to shorten our query? We simply want to fetch recordings within the particular date range (1 day).
Thanks for your support and coordination.
10-24-2016 08:29 AM
Hi Bilal,
We are checking in the code that how you can get all recording which fulfil the search criteria. We will get back to you ASAP.
Regards,
Ambrose Dev
10-25-2016 03:53 AM
Hi Ambrose,
Thanks for all the efforts, appreciate that.
We aren't sure aboutmediasense strategy of returning results against queries as its conflicting with what's mentioned in the documents. Looking forward to hear from you soon.
Thanks for your support and coordination.
10-31-2016 11:02 PM
11-02-2016 05:10 AM
hi Bilal,
You can use custom query like below to get more than 100 results or all results which fall in your search criteria.
========================================================================================
{"requestParameters":[{"fieldName":"sessionState","fieldConditions":[{"fieldOperator":"equals","fieldValues"
:["ACTIVE"],"fieldConnector":"OR"},{"fieldOperator":"equals","fieldValues":["CLOSED_NORMAL"],"fieldConnector"
:"OR"},{"fieldOperator":"equals","fieldValues":["CLOSED_ERROR"]}],"paramConnector":"AND"},{"fieldName"
:"sessionStartDate","fieldConditions":[{"fieldOperator":"between","fieldValues":[1452167369673,4631687369673
]}]}],"pageParameters":{"offset":0,"limit":200},"sortParameters":[{"byFieldName":"sessionStartDate","order"
:"DESC"}]}
========================================================================================
"pageParameters":{"offset":0,"limit":200}
In above query, I set limit say 200, so it would return me first 200 results. If I set offset to some value say 100, it would skip 100 sessions and then return result from 101th session to 300th session.
Hope this would help you.
Regards,
Ambrose Dev
11-02-2016 07:56 AM
Hi Ambrose,
Thanks for your useful reply.
We just successfully executed the query with offset: 0 and limit: 1000. But, when we increased the limit to 2000 we got failure response with error code: 4064 and according to the documentation this means that Failure: The limit parameter is invalid. And according to the documentation of parameter 'limit', By default, it returns the first 100 records. Any positive value greater than zero (0). Maximum possible value for this parameter is 1000.
So, It's quite clear now that why it's working with the maximum of 1000 as limit.
Thanks for your support and all the efforts.
11-17-2016 07:06 AM
Hi ambdev
After applying solution provided by you, we are getting 1000 records after the query. But we are observing one thing that when we apply limit and offset parameters we just get 'ACTIVE' calls while we should get all types of call as we have not applied any such filter. While before, we were getting calls with all statuses (Active, Recorded, Error) during specified period mentioned in the query.
So, It would be a great favor if you verify this scenario at your end too that if this happens at your end as well or not.
Thanks for your usual support and coordination.
11-17-2016 07:15 AM
Hi Bilal,
I will check the query provided by me and get back to you.
12-06-2016 09:50 PM
hi Bilal,
Sorry for late reply. I checked the query provided by me. It return me all the recordings with state ACTIVE, CLOSED_NORMAL and CLOSED_ERROR. Can you provide the query you are using?
12-19-2016 01:29 AM
Hi Ambrose,
Thanks for the update. I am also using the query shared by you. I would re-verify it and come back to you. thanks
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide