solved Bridge Search & Pagination

amartins
@amartins
8 years ago
48 posts
Hi.
I am trying to get pages using bridge search but the returned JSON data is always the same, no matter which page I request.

Here is the request form:
http://my.awesome.jamroom.dom/api/bridge/tracks/search?pagebreak=20&page=3&limit=200

And I get this info in response:
{
    "code": 200
    "text": "OK"
    "data": {
        "_items": [20]
           ···
        
        "info": {
            "total_items": 100
            "total_pages": 5
            "next_page": 2
            "pagebreak": 20
            "page": 1
            "this_page": 1
            "prev_page": 0
        }
    }
}

It was supposed to return "next_page": 4 and "this_page":3.
Is this any issue or am I doing something wrong?
Thanks.
updated by @amartins: 12/25/16 03:33:27AM
douglas
@douglas
8 years ago
2,790 posts
I would guess that you can NOT use pagebreak and limit together, its either one or the other.

Hope this helps!


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
amartins
@amartins
8 years ago
48 posts
Thanks Douglas.

But without limit the result is worse:

{
    "code": 200
    "text": "OK"
    "data": {
        "_items": [10]
            ···

        "info": {
            "total_items": 10
            "total_pages": 1
            "next_page": 0
            "pagebreak": 20
            "page": 1
            "this_page": 1
            "prev_page": 0
        }
    }
}

Per documentation total items should be 100...

Seems like something's wrong here :(
douglas
@douglas
8 years ago
2,790 posts
Yeah, we'll have to get Brian to check this out.


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
brian
@brian
8 years ago
10,148 posts
This has been fixed in the latest Proxima Bridge module - update and let me know if you see any issues.

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
amartins
@amartins
8 years ago
48 posts
Hi Brian.
Thanks it is much better, pagination is working but:
- still have to append '&limit=maxItems'
- I have 500 items but max is 100 no matter what number greater than 100 I put in limit.

Can this be fixed or changed?

Thanks for you attention!
updated by @amartins: 09/24/16 04:50:10PM
brian
@brian
8 years ago
10,148 posts
I've pushed new versions of the Proxima Core and Proxima Bridge modules - Proxima Core has been updated with a new "Max Search Results" global config option so you can set it to something higher than the default of 100.

I'd recommend however finding a way to NOT return 500+ results - that's a lot of data to move over the wire, and unless you really need that many results you'll get better performance using smaller result sets.

Let me know if that helps.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
amartins
@amartins
8 years ago
48 posts
Hi Brian thanks.
Yes 500 or more results it's a lot of data to get at once! So that's why I am using pagination method to get 20 results per page.

What I mean is that If I have 500 records and if I get 20 results/page, it should me return 25 pages. I can only get the first 100 results in 5 pages containing 20 results each.

So if I set limit to 500 it should override the default value, does it make sense?

Thanks!
brian
@brian
8 years ago
10,148 posts
No - that sounds wrong - my guess is you are using BOTH "limit" and "pagebreak" at the same time. If you need pagination do not use "limit" - use ONLY "pagebreak".

Also - unless you need to be able to jump to a page in the result set, use "simplepagebreak" instead of "pagebreak" - it's much faster.

Let me know if that helps.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
amartins
@amartins
8 years ago
48 posts
Hi Brian!
The 'simplepagebreak' is all that I needed... Works fine.

Thanks!

Tags