• Faceted navigation

last modified September 12, 2008 by dbaty

Performance enhancement

Cache

Damien has profiled the code and concluded that most of the time is spent in getResults() (which is linear, since it has to run over the brains of all matching items). He doesn't really know how to change the algorithm to avoid that.

He therefore proposed the following cache policies (from the least discriminant to the most):

  • all users see the same: all users will see the same results as the first user who has filled the cache. It could be enough for most sites. Hopefully, there will be a new option that enable pre-set criteria (which would let the administrator restrict the results to published item, for example);
  • user roles: not bad, but will not take local roles in account;
  • user id: default policy. (Actually, for anonymous users, our cache key is the view.)

Of course, the cache will be invalidated when the catalog is updated.

Damien already has some working (or semi-working code) for that.

Dedicated catalog

Using a dedicated, lightweight catalog is faster (about 10 times faster). We should implement that.

Widgets

Currently, there is only one widget (to select a value for a facet): a checkbox. We would like to implement other widgets.

Calendar widget

Of course, we want a widget to select dates. The default calendar selection widget (used in the Event edit form) could be a good choice. We should have to widgets: calendar_value (to select a single date) and calendar_min_max (to select an interval).

Slider widget

It would be useful to have a slider to select numeric values or interval of numeric values. After a brief argument ;), we have opted for an horizontal slider, with one or two marker.

An extra feature could be to have a zoom/unzoom button that would change the interval bounds (the minimal and maximal values of the slider). That is:

  1. Minimal value of the slider is 100, maximal value is 1000. These are the minimal and maximal values of the currently matching items.
  2. The user selects a maximal value with the slider, say 200.
  3.  Minimal value of the slider is 100, maximal value is still 1000.
  4. The user clicks on the zoom button.
  5. The minimal value of the slider is 100, maximal value is now 200.
  6. The user clicks on the unzoom button.
  7. The minimal value of the slider is 100, maximal value is now 1000.

Automatic interval widgets

Jérôme proposed a nice idea: when numeric values are used for a facet (but it might perhaps be used with dates, too), we could automatically define pertinent intervals and display the corresponding checkboxes.


Tag cloud widget

Souheil proposed to have a tag cloud-like widget.



User interface

Configuration interface

Some think that the configuration interface could be a bit more user-friendly: we could move facets around with the mouse, select index among existing indexes, etc.

User interface

Some may want to allow the user to reorder facet blocks. Others think that it would not be that useful: it is not a dashboard.

Another interesting idea could be to propose to the users multiple views (as the current folder content type does): listing (with title only, or title and description), thumbnails view, etc. However, we are not sure whether it should be a site-wide configuration or a per-user configuration.

Using Plone CSS classes could help. Currently, facet blocks are not really elegant, to say the least.

Pierre argued that there might be use cases where the user would want to select more than one value for a facet and have an union (OR) of the matching items, instead of the current intersection (AND). Though, we would still make an intersection of all facets. This configuration could be made either per-user or site-wide.

Among (a lot of) other ideas, Yann has proposed to discriminate results by having a splash screen that would let the user select a value for one of the facets, and then proceed to the faceted navigation. We have concluded that this is a good idea, but this splash screen would surely often be customized. In other words, there is no plan to implement that soon. ;)

I18n

We do not have tested it but, since the product uses the catalog, it should properly deal with translated items. Values would also be translated, as well. The only issue could be the translation of the facet (its name). In this case, integrator could simply customize a template to select the right message catalog.

Hierarchical facets

This is a hot topic. A bit hard to summarize all that has been said, but:

  • user interface: there is more than one way to do it. Though not in Perl, we are not pervert, are we?
    • a tree-like interface, where the user can expand/reduce (i.e. show/hide sub-values) a facet value by clicking a small plus/minus icon;
    • an interface where clicking a value would actually replace the portlet by a new portlet that contains sub-values.
  • implementation: supposing that values and sub-values are implemented as folderish items (though outside of the Faceted Navigation product), we could be able to fetch sub-values with catalog queries.

Not discussed or postponed

  • placeful faceted navigation;
  • tests of user interface: probably with Selenium.