Can I use my own field for a custom date, and use it for sorting?

Yes, you can use a custom date field. For example, if you want to use a published date 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 a 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:



Sorting can also be done using sort=published&sortdir=des with the following query parameters:



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.

Have more questions? Submit a request


  • Avatar
    Robert Dennis

    I found that using the format:

    <meta name="published" content="20140315T01:50:58"/>

    kept the page from being indexed.

    While using the format

    <meta name="published" content="2014-03-15T01:50:58"/>

    worked as expected.

    This article seems to state that both formats are acceptable. Is this a bug, or a mistake in this article? 

    Edited by Robert Dennis
  • Avatar
    David Hoernig

    In reply to Robert Dennis:

    I had the same experience using version 8.5.1 but found that treating the published value as a string in the mapping.json resolved the issue.

     "published": {
    "type": "string",
    "store": "yes",
    "analyzer": "alpha_analyzer",
    "include_in_all": "false"