Advantage of Virtual Date Facets
Using virtual date faceting saves on index, while providing greater flexibility.
For example, let us say that each document has a date/time of:
2013/05/12 15:05:12
Before virtual date faceting, date synthesis required that the analysis preprocess all dates and create a category per year, month, and day for them, as well as one per hour, minute, second if time synthesis was required.
Now, with virtual faceting, no specific analysis is required. In your search logic, you can
define which categories to create. For example, for year and month faceting, create a
DateFacet
with withYear
and withMonth
set to true
, and all others set to false
.
Synthesis can be enabled independently for year, month, week, day, hour, minute, and second.
DateFacets
refinements behave differently for full dates (such as
Year/month or Year/month/day/hour) than for other date-time combinations (such as
Year/hour).-
For full dates, refinements are done efficiently with a numerical search.
-
For other date-time combinations, refinements are done with a less efficient
attrnum
query.