Use advanced filters in custom search form on DSpace homepage

49 views
Skip to first unread message

Jakub Řihák

unread,
Feb 21, 2017, 11:22:54 AM2/21/17
to dspac...@googlegroups.com

Hello everybody,

we are using DSpace 5.5 and we would like to to create a custom search form on DSpace homepage, allowing us to use advanced filters together with search query in a similar fashion as it is possible on Discovery page (e.g. https://dspace.cuni.cz/discover). Is it possible to add a custom search field together with advanced filters?

The idea is to have a search field at the top of the homepage, followed by list of communities. So far I was able to just add a simple search field without any additional filtering options (https://dspace.cuni.cz) by modifying news-xmlui.xml file:

<div id="aspect.discovery.SiteViewer.div.front-page-search-custom" interactive="yes" rend="primary" action="/discover" n="front-page-search" method="get">
    <head>Search DSpace</head>
    <p>Enter some text in the box below to search DSpace.</p>
    <p>
        <field id="aspect.discovery.SiteViewer.field.query" n="query" type="text"> <params/> </field>
        <field id="aspect.discovery.SiteViewer.field.submit" n="submit" type="button"> <params/> <value type="raw">Go</value> </field>
    </p>
</div>

(it is an example code I got from http://wiki.lib.sun.ac.za/index.php?title=SUNScholar/XMLUI_Theme/M1/Page_Structure)

Our Dspace installation details:

DSpace version
: 5.5

UI: XMLUI / Mirage 2 theme

Thank you in advance,
best regards,

Jakub Řihák


Charles University

Czech Republic



Vlastimil Krejčíř

unread,
Jan 14, 2020, 5:28:42 AM1/14/20
to DSpace Technical Support
Hi all,

I'd like to reopen Jakub's question.

I've just been asked to prepare custom search form in our DSpace (version 5) to allow users to search specific fields like title, author, keywords etc.
I understand the concept of the filters in DSpace (search for a general term and then filter results), but it doesn't help me a lot in my specific case, because I can search for "foo" and then, when I want to search "foo" only in dc.title, I must(?) add a new filter Title contains "foo".

I can see how the GET parameters in such URL looks like and I can construct such URL, but I must(?) send the query string two times (via two different GET parameters) - that complicates the creation of a simple custom form search. I can do that using javascript, however, is there any way how to do it easier?

Regards,

Vlastik

--
----------------------------------------------------------------------------
Vlastimil Krejčíř
Library and Information Centre, Institute of Computer Science
Masaryk University, Brno, Czech Republic
Email: krejcir (at) ics (dot) muni (dot) cz
Phone: +420 549 49 3872
OpenPGP key: https://kic-internal.ics.muni.cz/~krejvl/pgp/
Fingerprint: 7800 64B2 6E20 645B 56AF  C303 34CB 1495 C641 11B9
----------------------------------------------------------------------------

Dne úterý 21. února 2017 17:22:54 UTC+1 Jakub Řihák napsal(a):

Ondřej Košarko

unread,
Jan 14, 2020, 10:27:40 AM1/14/20
to Vlastimil Krejčíř, DSpace Technical Support
Hi,
You should be able to use solr document field names in your queries, eg to search only in authors, search for:
 - author_keyword:"Bloggs*" wont work but author_keyword:"Bloggs, J" should.
and similarly for title. It might be a bit tricky to choose the right field - there are multiple solr fields based off of single metadata value, they differ in the processing chain. The author (above in author: and author_keyword) is a indexFieldName from discovery.xml. Also don't put a space after the colon (:).

Hope that helps.
Ondrej

út 14. 1. 2020 v 11:28 odesílatel Vlastimil Krejčíř <kre...@ics.muni.cz> napsal:
--
All messages to this mailing list should adhere to the DuraSpace Code of Conduct: https://duraspace.org/about/policies/code-of-conduct/
---
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/95439e40-2f19-4ffc-9adc-dc8469320987%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages