Developers
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
New Creator

Search G2 row limit

Jump to solution

My question is related "_maxRows" limit with Search G2.

I could not change the maxRows limitation. The max of rows limit is 200.

I have many post and I'm listing the posts with pagination. So, cps.row is 50 and we are listing the posts step by step.

But I need to see all results without pagination. My page has a PDF export option and we have to export all item acording to filter. The export feature has been operating via pdfmyurl API. This API uses the CSS @media print and remove unnecessary styles with this css file and then convert the printable view to a PDF file.

So, when ı provide a URL and a CSS file, the pdfmyurl is return a pdf. Like example link below;
pdfmyurl.com/api?license=key&url=page&css=file

What we have done to solve?

To solve the issue we have added a parameter end of the URL, like showall=true and requested the search queries according to page numbers and append then to a div when exist showall.


But this is not best practice because ordering is wrong. Requests return times are different. We could not find a way to solve asynchronous in Search G2.

We have created an array and collected the data according to request order and then place the data to a result div. But this time pdfmyurl API did not wait the result and exported only empty page.

Could you please provide an approach or solution ?

Labels (3)
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Partner Enablement
Partner Enablement

Re: Search G2 row limit

Jump to solution

The SearchG2 Javascript SDK does have a hard-coded limit of 200 rows per page of results. While you could construct a Solr query URL of your own and bypass this limit, there are important considerations on both efficiency and performance with large row numbers or start indexes of the Search G2 service. 

The solution you have attempted (adding the showall parameter) doesn't solve the fundamental problem because you pass the URL to pdfmyurl service but rely on client-side (browser) code to populate the div.

Fundamentally, you need to move away from client-side querying of the search collection. Alternative solutions:

  • Implement your own PDF export in server-side code -- this removes the dependency on the pdfmyurl service at the cost of having to integrate a PDF generation library (consider iText)
  • Implement a server-side "page" that assembles the full HTML to convert to PDF. This page should use Solr cursors to retrieve all the relevant rows from search. The URL to this "export" page can then be passed to pdfmyurl.

 

View solution in original post

1 Reply
Highlighted
Partner Enablement
Partner Enablement

Re: Search G2 row limit

Jump to solution

The SearchG2 Javascript SDK does have a hard-coded limit of 200 rows per page of results. While you could construct a Solr query URL of your own and bypass this limit, there are important considerations on both efficiency and performance with large row numbers or start indexes of the Search G2 service. 

The solution you have attempted (adding the showall parameter) doesn't solve the fundamental problem because you pass the URL to pdfmyurl service but rely on client-side (browser) code to populate the div.

Fundamentally, you need to move away from client-side querying of the search collection. Alternative solutions:

  • Implement your own PDF export in server-side code -- this removes the dependency on the pdfmyurl service at the cost of having to integrate a PDF generation library (consider iText)
  • Implement a server-side "page" that assembles the full HTML to convert to PDF. This page should use Solr cursors to retrieve all the relevant rows from search. The URL to this "export" page can then be passed to pdfmyurl.

 

View solution in original post