Date range searching - index field support

Project:RUcore SOLR Searching and Indexing
Version:7.5
Component:Code
Category:task
Priority:critical
Assigned:triggs
Status:closed
Description

In support of the OA initiative I need a Solr index field type DateField to support date range searching.

The initial specification entry can be found here, item #4.

<a href="https://rucore.libraries.rutgers.edu/collab/ref/spc_steering_r7_4_scholarship_search_browse_help_etc.pdf" title="https://rucore.libraries.rutgers.edu/collab/ref/spc_steering_r7_4_scholarship_search_browse_help_etc.pdf">https://rucore.libraries.rutgers.edu/collab/ref/spc_steering_r7_4_schola...</a>

I need a field that uses the logic in the specification to determine date and store it in the index. I am going to query Solr using the following guide:

<a href="https://wiki.apache.org/solr/SolrQuerySyntax#Differences_From_Lucene_Query_Parser" title="https://wiki.apache.org/solr/SolrQuerySyntax#Differences_From_Lucene_Query_Parser">https://wiki.apache.org/solr/SolrQuerySyntax#Differences_From_Lucene_Que...</a>

Note in the guide the date value stored needs to...

"...note that if you use the Solr "DateField" type, any queries on those fields (typically range queries) should use either the Complete ISO 8601 Date syntax that field supports, or the DateMath Syntax to get relative dates."

I need this for my own 7.5 development.

Comments

#1

Status:active» test

I've created a new, dynamic Solr dt field called sortdate_dt based on the integer sortdate_i, which already follows the algorithm set out in the May 7th spec. These dates don't have the time info for UTC dates, so I've added in zeros in these fields. Thus a sortdate_i of 20101001 becomes sortdate_dt 2010-10-01T00:00:00.000Z. I'm running portalcron refreshType=fedora now on devel (about 4% complete at the moment). It should be ready for testing in an hour or so.

#2

Status:test» fixed

Thanks, works as expected.

#3

Status:fixed» closed

Back to top