Yes, you can use a custom date field.
Sorting can also be done directly using the parameters sort=published&sortdir=desc with the following query parameters:
Date as facet field
For example, if you want to use a published date as a facet field with the following meta tag in your HTML page:
<meta name="published" content="2014-03-15T01:50:58"/>
<meta name="created_date" content="2014-03-15"/>
Note: The format of date should be as above
1. You will need to add the following mapping to the mapping.json file found within the /searchblox/WEB-INF folder, and then create a new collection to index the web pages:
2. Restart SearchBlox, delete, recreate and index the collection
3. The user can filter the date directly
4. The search results can be filtered based on a specified range of this date field “published” using the URL below:
You can also use the following meta tag for date without the time information:
<meta name="published" content="2013-09-12"/>
Use the URL below to get the date range:
Mapping custom date format
If your date field has a custom date format it has to be mapped in ../searchblox/WEB-INF/mapping.json
For example if your meta date is as below
<meta name="published" content="2014-03-12 01:50:58"/>
Mapping to be provided in mapping.json
"format": "yyyy-MM-dd HH:mm:ss"
If the custom date has to appear in search results the it is required to make necessary changes to ../searchblox/stylesheets/default.xsl for regular search.
For faceted suggest using angular json plugin where it is more flexible to add date related facets in results.