[daisy] Faceted Browser - Datetime format
Paul Focke
paul at outerthought.org
Fri Jan 4 02:04:16 CST 2008
Hi
The facet browser works like this.
You create a facet by defining an expression. Each unique result of this
expression results in a facet value.
What you are asking below is to group facet values. It seems like you
wish to define buckets for these values using an expression which might
be quite a nice addition. This bucket would need an expression which
evaluates to true when the facet value belongs to the bucket and a
label.
So if we dream on then we get a facet expression that looks a bit like
<facet expression="lastModified">
<buckets>
<bucket label="today" expression="{} > CurrentDateTime('-1 days')"/>
<bucket label="this week" expression="{} > RelativeDateTime('start
this week')"/>
<bucket label="this month" expression="{} > RelativeDateTime('start
this month')"/>
<!-- and so on and so forth -->
</buckets>
</facet>
Another syntax for the facets might use the currently existing
properties. This has the advantage that the current schema doesn't need
any changes. The bucket properties just need to be handled properly.
<facet expression="lastModified">
<properties>
<property name="bucket.1.label" value="today"/>
<property name="bucket.1.expression" value="{} > CurrentDateTime('-1
days')"/>
<!-- and so on and so forth -->
</properties>
</facet>
A little more explanation : '{}' is the resulted value from the value
expression. The functions I've used are available in the daisy query
language.
Sadly the bucket expressions won't be evaluated in the context of a
daisy query so this would mean that the bucket expressions would need
their own little expression language & parser.
Another note. The facet browser has the possibility of grouping values
using a simple algorithm that groups values into a predefined number of
groups. However it is not possible to define which values fall in to
which groups it is purely based on volume.
If you look in the mailing list archives I believe you might find some
discussions on this topic.
Paul
On Thu, 2008-01-03 at 22:16 -0800, shivshan wrote:
> Put another way, is it possible to do simple comparisions (<,>,= etc) in the
> facet expression?
> I tried a few but didn't work.
> Shiva
>
>
> shivshan wrote:
> >
> > Hi
> > I am trying to use lastModified as a facet. However, i would like to split
> > the range for last week, last month etc.
> > However, Month(lastModified) gives something like this:
> >
> > 11 - 11
> > 12 - 12
> >
> > Anyway i can make this facet look like:
> >
> > Today
> > Last Week
> > This Month
> >
> > etc?
> > Thanks
> > Shiva
> >
>
More information about the daisy
mailing list