Open bobstarbird opened 5 years ago
For Vue apps you need to modify the pageLength property (in typedSearchState function) in ui/src/store.js to modify page length. Not sure for React
This is a helpful ticket, because this is likely to be fairly common, and the current implementation breaks expectations.
The named search options stored in MarkLogic are unable to set page length because of several points at which eager code will default it to 10:
the front-end usually sets it. a. In the React stack, grove-search-redux defaults the pageLength property of the stagedSearch to 10. In fact, the grove-search-redux library currently lacks an action to change the page length. ... ... I have overridden this in at least one project by circumventing the pageLength property of the stagedSearch, and directly changing the pageLength. See, eg, https://project.marklogic.com/repo/projects/INT/repos/rpaas/browse/rpaas-ui/ui/src/containers/EntitySearchContainer.js#68 ... but that is fairly invasive. b. In the Vue stack, as @danielholgate mentioned, it can be reset in ui/src/store.js: https://github.com/marklogic-community/grove-vue-ui/blob/9af54252f8544afc89ff9b18e2043f85f9c63a86/src/store.js#L137
if the front-end does not set it, the middle-tier will set it to 10.
I think we should:
I think you had to override it in the frontend in slush-ml-node as well, rather than in the search options. That said, it should be possible to rely more on backend to provide a default page length, as long as it would still be possible to override it from front-end, in case a user specifies page length from the ui (for instance using a page length drop down or such)..
search:options page-length 10 behaves as if it is hard-coded in js. Changing search options file all.xml has no effect. I could not find where to change the value in the js source. Documenting how to change it would be helpful.