title: Search for Objects in DSpace that holds a custom made meta data field, and that matches a date range
body: <p><a href="http://i.stack.imgur.com/iKPUr.png" rel="nofollow">SCREENSHOT</a> I've made a custom meta data field (date type), now I want to search for Objects in DSpace that holds the meta data field, and that matches a date range is that possible? I guess I would need a search filter for my custom made meta data. So I configured this field as a Discovery (SOLR) search filter</p>
  
  <p>should it be enough to add the metadata field to the list below in config/spring/api/discovery.xml
  </p>
  
  <pre><code>&gt;&gt; &gt;&gt;         &lt;property name="searchFilters"&gt;
  &gt;&gt; &gt;&gt;             &lt;list&gt;
  &gt;&gt; &gt;&gt;                 &lt;ref bean="searchFilterTitle" /&gt;
  &gt;&gt; &gt;&gt;                 &lt;ref bean="searchFilterAuthor" /&gt;
  &gt;&gt; &gt;&gt;                 &lt;ref bean="searchFilterSubject" /&gt;
  &gt;&gt; &gt;&gt;                 &lt;ref bean="searchFilterIssued" /&gt;
  &gt;&gt; &gt;&gt;             &lt;/list&gt;
  &gt;&gt; &gt;&gt;         &lt;/property&gt;
  </code></pre>
  
  <p>and also to configure it at the bottom of the file, where the other filters are configured</p>
  
  <p><a href="https://github.com/DSpace/DSpace/blob/master/dspace/config/spring/api/discovery.xml#L363" rel="nofollow">https://github.com/DSpace/DSpace/blob/master/dspace/config/spring/api/discovery.xml#L363</a></p>
  
  <p>Now I have done all this but searching does not work. I have done mvn package in source and cd dspace/target/dspace4-0build ant update and then ./dspace index-discovery</p>
  
  <p>I still can't get this to work, please do you have any advice?</p>
  
  <p>Here is the content of my discovery.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!--
  
      The contents of this file are subject to the license and copyright
      detailed in the LICENSE and NOTICE files at the root of the source
      tree and available online at
  
      http://www.dspace.org/license/
  
  --&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:context="http://www.springframework.org/schema/context"
         xmlns:util="http://www.springframework.org/schema/util"
         xsi:schemaLocation="http://www.springframework.org/schema/beans
             http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
             http://www.springframework.org/schema/context
             http://www.springframework.org/schema/context/spring-context-3.0.xsd
             http://www.springframework.org/schema/util
             http://www.springframework.org/schema/util/spring-util-3.0.xsd"
      default-autowire-candidates="*Service,*DAO,javax.sql.DataSource"&gt;
  
      &lt;context:annotation-config /&gt; &lt;!-- allows us to use spring annotations in beans --&gt;
  
      &lt;bean id="solrServiceResourceIndexPlugin" class="org.dspace.discovery.SolrServiceResourceRestrictionPlugin" scope="prototype"/&gt;
      &lt;bean id="SolrServiceSpellIndexingPlugin" class="org.dspace.discovery.SolrServiceSpellIndexingPlugin" scope="prototype"/&gt;
  
      &lt;alias name="solrServiceResourceIndexPlugin" alias="org.dspace.discovery.SolrServiceResourceRestrictionPlugin"/&gt;
  
      &lt;!-- Additional indexing plugin to implement the browse system via SOLR --&gt;
      &lt;bean id="solrBrowseIndexer" scope="prototype"
            class="org.dspace.browse.SolrBrowseCreateDAO"&gt;
      &lt;/bean&gt;
  
      &lt;!--Bean that is used for mapping communities/collections to certain discovery configurations.--&gt;
      &lt;bean id="org.dspace.discovery.configuration.DiscoveryConfigurationService" class="org.dspace.discovery.configuration.DiscoveryConfigurationService"&gt;
          &lt;property name="map"&gt;
              &lt;map&gt;
                  &lt;!--The map containing all the settings,
                      the key is used to refer to the page (the "site" or a community/collection handle)
                      the value-ref is a reference to an identifier of the DiscoveryConfiguration format
                      --&gt;
                  &lt;!--The default entry, DO NOT REMOVE the system requires this--&gt;
                 &lt;entry key="default" value-ref="defaultConfiguration" /&gt;
  
                 &lt;!--Use site to override the default configuration for the home page &amp; default discovery page--&gt;
                 &lt;entry key="site" value-ref="homepageConfiguration" /&gt;
                 &lt;!--&lt;entry key="123456789/7621" value-ref="defaultConfiguration"/&gt;--&gt;
              &lt;/map&gt;
          &lt;/property&gt;
          &lt;property name="toIgnoreMetadataFields"&gt;
              &lt;map&gt;
                  &lt;entry&gt;
                      &lt;key&gt;&lt;util:constant static-field="org.dspace.core.Constants.COMMUNITY"/&gt;&lt;/key&gt;
                      &lt;list&gt;
                          &lt;!--Introduction text--&gt;
                          &lt;!--&lt;value&gt;dc.description&lt;/value&gt;--&gt;
                          &lt;!--Short description--&gt;
                          &lt;!--&lt;value&gt;dc.description.abstract&lt;/value&gt;--&gt;
                          &lt;!--News--&gt;
                          &lt;!--&lt;value&gt;dc.description.tableofcontents&lt;/value&gt;--&gt;
                          &lt;!--Copyright text--&gt;
                          &lt;value&gt;dc.rights&lt;/value&gt;
                          &lt;!--Community name--&gt;
                          &lt;!--&lt;value&gt;dc.title&lt;/value&gt;--&gt;
                      &lt;/list&gt;
                  &lt;/entry&gt;
                  &lt;entry&gt;
                      &lt;key&gt;&lt;util:constant static-field="org.dspace.core.Constants.COLLECTION"/&gt;&lt;/key&gt;
                      &lt;list&gt;
                          &lt;!--Introduction text--&gt;
                          &lt;!--&lt;value&gt;dc.description&lt;/value&gt;--&gt;
                          &lt;!--Short description--&gt;
                          &lt;!--&lt;value&gt;dc.description.abstract&lt;/value&gt;--&gt;
                          &lt;!--News--&gt;
                          &lt;!--&lt;value&gt;dc.description.tableofcontents&lt;/value&gt;--&gt;
                          &lt;!--Copyright text--&gt;
                          &lt;value&gt;dc.rights&lt;/value&gt;
                          &lt;!--Collection name--&gt;
                          &lt;!--&lt;value&gt;dc.title&lt;/value&gt;--&gt;
                      &lt;/list&gt;
                  &lt;/entry&gt;
                  &lt;entry&gt;
                      &lt;key&gt;&lt;util:constant static-field="org.dspace.core.Constants.ITEM"/&gt;&lt;/key&gt;
                      &lt;list&gt;
                          &lt;value&gt;dc.description.provenance&lt;/value&gt;
                      &lt;/list&gt;
                  &lt;/entry&gt;
              &lt;/map&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;!--The default configuration settings for discovery--&gt;
      &lt;bean id="defaultConfiguration" class="org.dspace.discovery.configuration.DiscoveryConfiguration" scope="prototype"&gt;
          &lt;!--Which sidebar facets are to be displayed--&gt;
          &lt;property name="sidebarFacets"&gt;
              &lt;list&gt;
                  &lt;ref bean="searchFilterAuthor" /&gt;
                  &lt;ref bean="searchFilterSubject" /&gt;
                  &lt;ref bean="searchFilterIssued" /&gt;
              &lt;/list&gt;
          &lt;/property&gt;
          &lt;!--The search filters which can be used on the discovery search page--&gt;
          &lt;property name="searchFilters"&gt;
              &lt;list&gt;
                  &lt;ref bean="searchFilterTitle" /&gt;
                  &lt;ref bean="searchFilterAuthor" /&gt;
                  &lt;ref bean="searchFilterSubject" /&gt;
                  &lt;ref bean="searchFilterIssued" /&gt;
              &lt;/list&gt;
          &lt;/property&gt;
          &lt;!--The sort filters for the discovery search--&gt;
          &lt;property name="searchSortConfiguration"&gt;
              &lt;bean class="org.dspace.discovery.configuration.DiscoverySortConfiguration"&gt;
                  &lt;!--&lt;property name="defaultSort" ref="sortDateIssued"/&gt;--&gt;
                  &lt;!--DefaultSortOrder can either be desc or asc (desc is default)--&gt;
                  &lt;property name="defaultSortOrder" value="desc"/&gt;
                  &lt;property name="sortFields"&gt;
                      &lt;list&gt;
                          &lt;ref bean="sortTitle" /&gt;
                          &lt;ref bean="sortDateIssued" /&gt;
                      &lt;/list&gt;
                  &lt;/property&gt;
              &lt;/bean&gt;
          &lt;/property&gt;
          &lt;!--Any default filter queries, these filter queries will be used for all queries done by discovery for this configuration--&gt;
          &lt;!--&lt;property name="defaultFilterQueries"&gt;--&gt;
              &lt;!--&lt;list&gt;--&gt;
                  &lt;!--Only find items--&gt;
                  &lt;!--&lt;value&gt;search.resourcetype:2&lt;/value&gt;--&gt;
              &lt;!--&lt;/list&gt;--&gt;
          &lt;!--&lt;/property&gt;--&gt;
          &lt;!--The configuration for the recent submissions--&gt;
          &lt;property name="recentSubmissionConfiguration"&gt;
              &lt;bean class="org.dspace.discovery.configuration.DiscoveryRecentSubmissionsConfiguration"&gt;
                  &lt;property name="metadataSortField" value="dc.date.accessioned" /&gt;
                  &lt;property name="type" value="date"/&gt;
                  &lt;property name="max" value="20"/&gt;
                  &lt;!-- If enabled the collection home page will not display metadata but show a pageable list of recent submissions --&gt;
                  &lt;property name="useAsHomePage" value="false"/&gt;
              &lt;/bean&gt;
          &lt;/property&gt;
          &lt;!--Default result per page  --&gt;
          &lt;property name="defaultRpp" value="10" /&gt;
          &lt;property name="hitHighlightingConfiguration"&gt;
              &lt;bean class="org.dspace.discovery.configuration.DiscoveryHitHighlightingConfiguration"&gt;
                  &lt;property name="metadataFields"&gt;
                      &lt;list&gt;
                          &lt;bean class="org.dspace.discovery.configuration.DiscoveryHitHighlightFieldConfiguration"&gt;
                              &lt;property name="field" value="dc.title"/&gt;
                              &lt;property name="snippets" value="5"/&gt;
                          &lt;/bean&gt;
                          &lt;bean class="org.dspace.discovery.configuration.DiscoveryHitHighlightFieldConfiguration"&gt;
                              &lt;property name="field" value="dc.contributor.author"/&gt;
                              &lt;property name="snippets" value="5"/&gt;
                          &lt;/bean&gt;
                          &lt;bean class="org.dspace.discovery.configuration.DiscoveryHitHighlightFieldConfiguration"&gt;
                              &lt;property name="field" value="dc.description.abstract"/&gt;
                              &lt;property name="maxSize" value="250"/&gt;
                              &lt;property name="snippets" value="2"/&gt;
                          &lt;/bean&gt;
                          &lt;bean class="org.dspace.discovery.configuration.DiscoveryHitHighlightFieldConfiguration"&gt;
                              &lt;property name="field" value="fulltext"/&gt;
                              &lt;property name="maxSize" value="250"/&gt;
                              &lt;property name="snippets" value="2"/&gt;
                          &lt;/bean&gt;
                      &lt;/list&gt;
                  &lt;/property&gt;
              &lt;/bean&gt;
          &lt;/property&gt;
          &lt;property name="moreLikeThisConfiguration"&gt;
              &lt;bean class="org.dspace.discovery.configuration.DiscoveryMoreLikeThisConfiguration"&gt;
                  &lt;!--When altering this list also alter the "xmlui.Discovery.RelatedItems.help" key as it describes
                  the metadata fields below--&gt;
                  &lt;property name="similarityMetadataFields"&gt;
                      &lt;list&gt;
                          &lt;value&gt;dc.title&lt;/value&gt;
                          &lt;value&gt;dc.contributor.author&lt;/value&gt;
                          &lt;value&gt;dc.creator&lt;/value&gt;
                          &lt;value&gt;dc.subject&lt;/value&gt;
                      &lt;/list&gt;
                  &lt;/property&gt;
                  &lt;!--The minimum number of matching terms across the metadata fields above before an item is found as related --&gt;
                  &lt;property name="minTermFrequency" value="5"/&gt;
                  &lt;!--The maximum number of related items displayed--&gt;
                  &lt;property name="max" value="3"/&gt;
                  &lt;!--The minimum word length below which words will be ignored--&gt;
                  &lt;property name="minWordLength" value="5"/&gt;
              &lt;/bean&gt;
          &lt;/property&gt;
          &lt;!-- When true a "did you mean" example will be displayed, value can be true or false --&gt;
          &lt;property name="spellCheckEnabled" value="true"/&gt;
      &lt;/bean&gt;
  
  
      &lt;!--The Homepage specific configuration settings for discovery--&gt;
      &lt;bean id="homepageConfiguration" class="org.dspace.discovery.configuration.DiscoveryConfiguration" scope="prototype"&gt;
          &lt;!--Which sidebar facets are to be displayed (same as defaultConfiguration above)--&gt;
          &lt;property name="sidebarFacets"&gt;
              &lt;list&gt;
                  &lt;ref bean="searchFilterAuthor" /&gt;
                  &lt;ref bean="searchFilterSubject" /&gt;
                  &lt;ref bean="searchFilterIssued" /&gt;
              &lt;/list&gt;
          &lt;/property&gt;
          &lt;!--The search filters which can be used on the discovery search page (same as defaultConfiguration above)--&gt;
          &lt;property name="searchFilters"&gt;
              &lt;list&gt;
                  &lt;ref bean="searchFilterTitle" /&gt;
                  &lt;ref bean="searchFilterAuthor" /&gt;
                  &lt;ref bean="searchFilterSubject" /&gt;
                  &lt;ref bean="searchFilterIssued" /&gt;
                  &lt;ref bean="searchFilter11slutdatum" /&gt;
              &lt;/list&gt;
          &lt;/property&gt;
          &lt;!--The sort filters for the discovery search (same as defaultConfiguration above)--&gt;
          &lt;property name="searchSortConfiguration"&gt;
              &lt;bean class="org.dspace.discovery.configuration.DiscoverySortConfiguration"&gt;
                  &lt;!--&lt;property name="defaultSort" ref="sortDateIssued"/&gt;--&gt;
                  &lt;!--DefaultSortOrder can either be desc or asc (desc is default)--&gt;
                  &lt;property name="defaultSortOrder" value="desc"/&gt;
                  &lt;property name="sortFields"&gt;
                      &lt;list&gt;
                          &lt;ref bean="sortTitle" /&gt;
                          &lt;ref bean="sortDateIssued" /&gt;
                      &lt;/list&gt;
                  &lt;/property&gt;
              &lt;/bean&gt;
          &lt;/property&gt;
          &lt;!-- Limit recent submissions on homepage to only 5 (default is 20) --&gt;
          &lt;property name="recentSubmissionConfiguration"&gt;
              &lt;bean class="org.dspace.discovery.configuration.DiscoveryRecentSubmissionsConfiguration"&gt;
                  &lt;property name="metadataSortField" value="dc.date.accessioned" /&gt;
                  &lt;property name="type" value="date"/&gt;
                  &lt;property name="max" value="5"/&gt;
                  &lt;property name="useAsHomePage" value="false"/&gt;
              &lt;/bean&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;!--Search filter configuration beans--&gt;
      &lt;bean id="searchFilterTitle" class="org.dspace.discovery.configuration.DiscoverySearchFilter"&gt;
          &lt;property name="indexFieldName" value="title"/&gt;
          &lt;property name="metadataFields"&gt;
              &lt;list&gt;
                  &lt;value&gt;dc.title&lt;/value&gt;
              &lt;/list&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
          &lt;bean id="searchFilter11slutdatum" class="org.dspace.discovery.configuration.DiscoverySearchFilter"&gt;
          &lt;property name="indexFieldName" value="11slutdatum"/&gt;
          &lt;property name="metadataFields"&gt;
              &lt;list&gt;
                  &lt;value&gt;dc.nordiska.11slutdatum&lt;/value&gt;
              &lt;/list&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="searchFilterAuthor" class="org.dspace.discovery.configuration.DiscoverySearchFilterFacet"&gt;
          &lt;property name="indexFieldName" value="author"/&gt;
          &lt;property name="metadataFields"&gt;
              &lt;list&gt;
                  &lt;value&gt;dc.contributor.author&lt;/value&gt;
                  &lt;value&gt;dc.creator&lt;/value&gt;
              &lt;/list&gt;
          &lt;/property&gt;
          &lt;property name="facetLimit" value="10"/&gt;
          &lt;property name="sortOrder" value="COUNT"/&gt;
      &lt;/bean&gt;
  
      &lt;bean id="searchFilterSubject" class="org.dspace.discovery.configuration.HierarchicalSidebarFacetConfiguration"&gt;
          &lt;property name="indexFieldName" value="subject"/&gt;
          &lt;property name="metadataFields"&gt;
              &lt;list&gt;
                  &lt;value&gt;dc.subject.*&lt;/value&gt;
              &lt;/list&gt;
          &lt;/property&gt;
          &lt;property name="facetLimit" value="10"/&gt;
          &lt;property name="sortOrder" value="COUNT"/&gt;
          &lt;property name="splitter" value="::"/&gt;
      &lt;/bean&gt;
  
      &lt;bean id="searchFilterIssued" class="org.dspace.discovery.configuration.DiscoverySearchFilterFacet"&gt;
          &lt;property name="indexFieldName" value="dateIssued"/&gt;
          &lt;property name="metadataFields"&gt;
              &lt;list&gt;
                  &lt;value&gt;dc.date.issued&lt;/value&gt;
              &lt;/list&gt;
          &lt;/property&gt;
          &lt;property name="type" value="date"/&gt;
          &lt;property name="sortOrder" value="VALUE"/&gt;
      &lt;/bean&gt;
  
      &lt;!--Sort properties--&gt;
      &lt;bean id="sortTitle" class="org.dspace.discovery.configuration.DiscoverySortFieldConfiguration"&gt;
          &lt;property name="metadataField" value="dc.title"/&gt;
      &lt;/bean&gt;
  
      &lt;bean id="sortDateIssued" class="org.dspace.discovery.configuration.DiscoverySortFieldConfiguration"&gt;
          &lt;property name="metadataField" value="dc.date.issued"/&gt;
          &lt;property name="type" value="date"/&gt;
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>