Skip to content
Snippets Groups Projects
Commit 8ad8d18d authored by Marius Dumitru Florea's avatar Marius Dumitru Florea
Browse files

XWIKI-10090: Add 'Older than 30 days' option to the date facet

parent 4ddc49b5
No related branches found
No related tags found
No related merge requests found
......@@ -78,6 +78,11 @@
'end' : $startOfTomorrow,
'name' : '[NOW/DAY-30DAYS TO NOW/DAY+1DAY}',
'count': 0
}, {
'label': $services.localization.render('solr.facet.date.olderThan30Days'),
'end' : $startOfToday.minusDays(30),
'name' : '[* TO NOW/DAY-30DAYS}',
'count': 0
}
])
## 2. Date intervals specified on the request.
......
......@@ -629,15 +629,11 @@
## In order to support multi-select faceting we need to exclude the corresponding filters when faceting.
## See http://wiki.apache.org/solr/SimpleFacetParameters#Multi-Select_Faceting_and_LocalParams
#set ($facetFieldsWithFilterExcludes = [])
## Not all facets support multiple selection:
## * we use different query fields for different result types so the number of matches for the type facet changes when
## a result type is selected/unselected.
## * date facets have ranges that intersect and so multiple selection doesn't make sense
## (e.g. 'Today' is included in 'Last 7 days' so it doesn't make sense to select both)
#set ($facetFieldsWithSingleSelection = ['type', 'date', 'creationdate', 'attdate'])
#foreach ($facet in $facetFields)
#set ($excludeTaggedFilter = '')
#if (!$facetFieldsWithSingleSelection.contains($facet))
## The type facet doesn't support multiple selection because we use different query fields for different result
## types so the number of matches for the type facet changes when a result type is selected/unselected.
#if ($facet != 'type')
#set ($excludeTaggedFilter = "{!ex=$facet}")
#end
#set ($discard = $facetFieldsWithFilterExcludes.add("$excludeTaggedFilter$facet"))
......
......@@ -30,14 +30,11 @@
<creationDate>1385047506000</creationDate>
<parent>Main.SolrSearch</parent>
<author>xwiki:XWiki.Admin</author>
<customClass/>
<contentAuthor>xwiki:XWiki.Admin</contentAuthor>
<date>1385298756000</date>
<contentUpdateDate>1385298756000</contentUpdateDate>
<version>1.1</version>
<title>Solr Search Translations</title>
<defaultTemplate/>
<validationScript/>
<comment/>
<minorEdit>false</minorEdit>
<syntaxId>xwiki/2.1</syntaxId>
......@@ -118,6 +115,7 @@
solr.facet.date.today=Today
solr.facet.date.last7Days=Last 7 days
solr.facet.date.last30Days=Last 30 days
solr.facet.date.olderThan30Days=Older than 30 days
solr.facet.date.customInterval=Custom date &amp; time interval
solr.facet.date.start=Start date and time
solr.facet.date.end=End date and time
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment