Hi Cécile,
Sorry for the delay - it has taken me a little bit to track down the answer for you!
There is no easy way in the user interface to implement this change, so that search results display only top-level records first, by default. However, I think it may be a one-line code change for you to make.
Please note that other than a very fast local test to confirm this is the right line of code, we have NOT tested this in depth! If you are planning to make this change in a production instance of AtoM, I strongly recommend that you try it first in a development environment and test it thoroughly to ensure there are not any other unintended consequences!
Keep in mind as well that, as with all local code changes, you will need to re-apply this change again if you upgrade in the future.
The line that I think you should try changing is here:
<input type="hidden" name="topLod" value="0"/>
If you change the value to 1, then I think it will accomplish what you want - like so:
<input type="hidden" name="topLod" value="1"/>
This topLod parameter is a URL parameter associated with the top-level descriptions filter toggle available in the Advanced search. Try performing a search, opening the advanced search panel and adding or removing the top-level descriptions filter, and then look at the resulting search page URL - you will see in the parameters passed that topLod=1 appears when the top-level description filter is turned on, and topLod=0 will appear in the URL when the filter is turned off, so that all levels show.
This line of code we are editing currently tells AtoM that when a global search is performed, by default make the results apply to all descriptions. If you change it to 1, then you will essentially be telling AtoM to filter the results list to top-level descriptions. However, users will still be able to click and remove the top-level filter tag, or else open the Advanced search panel and remove it there.
After you make the change in the code and save it:
- Clear the application cache: php symfony cc
- Restart PHP-FPM - in AtoM 16.04 or 18.04 with PHP 7.2 this would be: sudo systemctl restart php7.2-fpm
- Remember that your web browser also has a cache - you may need to clear it to see changes, or else test in an incognito browser window.
And again - PLEASE test this thoroughly before making these changes in a production AtoM site!
Cheers,