To return only items in the empty search in DSpace 7.6 interface

111 views
Skip to first unread message

Manuela Ferreira

unread,
May 6, 2024, 2:42:02 PM5/6/24
to DSpace Technical Support
Hi!

I'm trying to find a way to return only items when performing an empty search in the search box of DSpace 7.6, meaning I don't want communities and collections to be returned in this search. 

As described at https://groups.google.com/g/dspace-tech/c/CDTHPHnZcm4/m/3YCzQcX9BQAJ, I tried modifying the defaultFilterQueries property in the defaultConfiguration in the file <dspace>/config/spring/api/discovery.xml, as shown below:

Before:
<!--The default configuration settings for discovery-->
    <bean id="defaultConfiguration" class="org.dspace.discovery.configuration.DiscoveryConfiguration" scope="prototype">
...
       <property name="defaultFilterQueries">
            <list>
                <!--Only find items, communities and collections-->
                <value>(search.resourcetype:Item AND latestVersion:true) OR search.resourcetype:Collection OR search.resourcetype:Community</value>
                <value>-withdrawn:true AND -discoverable:false</value>
            </list>
        </property>
...

After
<!--The default configuration settings for discovery-->
    <bean id="defaultConfiguration" class="org.dspace.discovery.configuration.DiscoveryConfiguration" scope="prototype">
...
       <property name="defaultFilterQueries">
            <list>
                <!--Only find items, communities and collections-->
<value>(search.resourcetype:Item AND latestVersion:true)</value>
                <value>-withdrawn:true AND -discoverable:false</value>
            </list>
        </property>

But this affected the search and listings of communities and collections when creating a new subcommunity/collection or item, respectively, causing the error "No community found". So, I reverted the modification.

Does anyone know how to make an empty search in the DSpace 7.6 interface return only items?

Thank you
Manuela Klanovicz Ferreira

Manuela Ferreira

unread,
Jul 12, 2024, 3:29:09 PM7/12/24
to DSpace Technical Support
Please, can someone help me with this question?

Thanks
Manuela Klanovicz Ferreira

DSpace Technical Support

unread,
Jul 15, 2024, 4:36:04 PM7/15/24
to DSpace Technical Support
Hi,

I have to be honest, I'm not aware of an easy way to achieve what you are looking for.  Currently, the DSpace User Interface is using those "defaultConfiguration" settings for *many* different search options... it's not just for the search page, but also for finding Communities/Collection when using the "New" or "Edit" menu.

Conceptually, it'd be better to find a way to create a separate Discovery configuration for searching only Collections and only Communities and ensure that the UI uses that for those "New" or "Edit" menus.  But, that'd require customization both to the backend and to the frontend.

I was hoping that maybe someone else would respond saying they've done this before.  I don't know the details myself. If you cannot figure it out,  you are welcome to add a new feature request ticket to https://github.com/DSpace/dspace-angular/issues and we can see if we can find a volunteer developer interested in helping out.

(Sidenote, this is all *somewhat* related to this ticket: https://github.com/DSpace/dspace-angular/issues/3168   But, that one is more about limiting the *type* of Items in some search results.  Nonetheless, it's possible these two ideas could have similar solutions)

Tim

Manuela Ferreira

unread,
Jul 15, 2024, 4:58:55 PM7/15/24
to DSpace Technical Support
Thank you very much, Tim!

I will try to do it, and if I succeed, I'll share it.

Manuela Klanovicz Ferreira
Reply all
Reply to author
Forward
0 new messages