Discovery Date Range Queries (DSpace 6)

32 views
Skip to first unread message

kpet

unread,
Nov 17, 2021, 6:32:13 AM11/17/21
to DSpace Technical Support
Hello,

I have a DSpace 6.3 installed on a linux machine, using tomcat 9, jre 1.8, ant 1.10 and maven 3.3.9.

I want to be able to perform a search query via the Discovery interface on a date field (e.g. dc.date.available) but for a date range, for example objects returned should have dc.date.available between March and May of 2021, i.e. dc.date.available >= 2021-03-01 && dc.date.available <= 2021-05-31

I have read the documentation of Discovery on how to add custom search filters but the problem is I also want to add a custom relational operator, as in "greater than". Currently, I only see Contains, Equals, ID, Not Contains, Not Equals, Not ID.

Any help would be greatly appreciated.

Sean Kalynuk

unread,
Nov 24, 2021, 11:07:04 AM11/24/21
to kpet, DSpace Technical Support

Hi,

 

You could try using the Solr range query syntax with the Equals comparison:

 

[2021-03-01 TO 2021-05-31]

 

DSpace 6.3 uses Solr 4.10.4, so additional information on range queries can be found in:

 

http://archive.apache.org/dist/lucene/solr/ref-guide/apache-solr-ref-guide-4.10.pdf

 

--

Sean

 

From: dspac...@googlegroups.com <dspac...@googlegroups.com> on behalf of kpet <kpetr...@gmail.com>
Date: Wednesday, November 17, 2021 at 5:32 AM
To: DSpace Technical Support <dspac...@googlegroups.com>
Subject: [dspace-tech] Discovery Date Range Queries (DSpace 6)

Caution: This message was sent from outside the University of Manitoba.

--
All messages to this mailing list should adhere to the Code of Conduct: https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
---
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/6d8c8661-d9e1-4e19-a6e6-93e17277e73fn%40googlegroups.com.

kpet

unread,
Nov 25, 2021, 3:08:40 AM11/25/21
to DSpace Technical Support
Hello,

thanks for the reply. I am trying to execute a search as you suggested, setting an "Equals" filter for dc.date.available to [2021-11-03T9:10:00Z TO 2021-11-03T16:30:00Z]. But when I execute the query no results come up. The full url of the request being made is (certain symbols have been URI-encoded): http://localhost:8080/xmlui/discover?filtertype_1=dc.date.available&filter_relational_operator_1=equals&filter_1=%5B2021-11-03T9%3A10%3A00Z%20TO%202021-11-03T16%3A30%3A00Z%5D&query=test&scope=/

I have confirmed that there should be results for this query.

Another thing to note is that even if I set dc.date.available to exactly equal the
value of a specific item's dc.date.available field, it still does not return the item.
Reply all
Reply to author
Forward
0 new messages