collective / collective.solr

Solr search engine integration for Plone
https://pypi.org/project/collective.solr/
21 stars 46 forks source link

25 results display cap #278

Closed WhiteDiamondz closed 2 years ago

WhiteDiamondz commented 3 years ago

Good morning,

I am running collective.solr on : Plone 5.2.2 (5209) CMF 2.4.8 Zope 4.5.1 Python 3.7.9 (default, Sep 29 2020, 20:40:55) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)] PIL 6.2.2 (Pillow) WSGI: On Server: waitress 1.4.4 I have no problem indexing to my Solr 8.5.2 collection, however, I am having trouble for getting back the results From what I can see in the debugger, search.min.js is handling all the creation of the display. I am getting the number of results that is expected on the line "x items matching your search terms." However, I am only displaying 25 of these results, with no option to go to another page to see the rest. I couldn't find anywhere where this might be coded... This is not linked to my collection config (when my own didn't work I tried it with the one you have : https://github.com/collective/collective.solr/tree/master/config/conf ) where I also tried adding to solrconfig.xml:

`

500
    <queryResultMaxDocsCached>500</queryResultMaxDocsCached>
</query>`

Going through the code of search.min.js I could see that I was building the array with the results and as soon as I was hitting the 25 length then I was going through the rendering Can this be modified anywhere ? In an old statement I could see that you had mentioned at some point the max-num-results attribute. This was removed in a commit of 2011 (https://github.com/collective/collective.solr/commit/4054b9c9d76d9fcbbd5b95fd740692b398183c25) if I am not mistaking, is there a new way to have something similar for the number of results we choose to display ?

Thank you very much for the help !

solrResult
WhiteDiamondz commented 3 years ago

Sorry for tagging you @djay @tisto , I saw you had contributed and I was wondering if you knew anything about this issue

tintin759 commented 2 years ago

Hi WhiteDiamondz, Did you find a solution for that ? Thank you so much.

tisto commented 2 years ago

@WhiteDiamondz @tintin759 unfortunately this setting can not be modified by a configuration parameter. You have to change the JavaScript code and then compile the JS again. The simple truth is that we build this UI some time ago and then moved on to Volto (new Plone 6 frontend in React) and we are not using any frontend components in c.solr any longer (just a rest backend api).

WhiteDiamondz commented 2 years ago

Hi @tintin759, As said by tisto, I wasn't able to find any configuration parameter to change the default value. As a matter of fact, the only fix I remember finding at the time implied directly modifying some code in plone/batching/utils.py file which clearly didn't look like the best solution. If there is a way to do so only by changing a specific js file I hadn't found it. Maybe @tisto you have a specific file in mind? I hadn't found the parameter in search.min.js but then again I could have missed it. Good luck !