FoCul Best Practice – Faceted Filtering in XPages Using Java Beans

Improved User Experience

We have found that one of the most difficult parts of developing modern XPage applications has been providing the faceted filtering that users expect from modern web apps.

By faceted I mean filtering that is intelligent – If I choose the Ford manufacturer I should not then be presented with choices for models from Audi.

This demo of the FoCul Knowledge Directory shows how we have achieved this in XPages without having to use SQL or SOLR databases.

XPages Knowledge Directory

 

Choosing any filter on the left then reduces the available choices in the other filters. Similarly clicking on any of the hyperlinks in the returned results filters deeper. This works much better than our old scheme.

Bound to Java Beans

This functionality is delivered by binding the data to Java Beans. The data collection is generated from a simple text search ( i.e. not a Full Text search ). The remaining filter options are derived from the data in this bean and as the collections gets smaller the remaining filter options are reduced.

If the user does a text search using the search box a Full Text search is performed against the collection of documents held in the java bean.

We opted not to use Full Text search by default as new records take too long to get added to the search index and users believed that their documents had not been created. This issue has been reported by many others.

This approach works well with the 500 records in this application. We have an improved version for larger applications which has what we call a “skinny bean” and a “full fat bean”.

Essentially if you are loading all of the data about a document into a back end bean the bottleneck is not getting the collection of documents but the process of reading the data into the bean. Christian Guedemann has written a good blog post about this. In the example above here the bean contains enough information to display all of the pages for all 500 records.

Skinny Beans V’s Fat Beans

In the improved version the “skinny bean” holds only enough information to derive the remaining filter options and the sort order for the results. A “fat bean” containing document information is then populated a page at a time as data is displayed. Using this approach the system scales to much larger volumes of data.

The pages does reload as each filter is applied. We do this to allow the URL to reflect the active search criteria. The impact of this is not significant but we hope to move away from the full page reload at a future release.

Andrew Champion developed this approach and will be blogging about some of the technical aspects.

The demo application is our Knowledge Directory Product. It allows organisations to capture and share knowledge about projects and products with an emphasis on finding the right people to talk to. It is available on a subscription basis on premises or SAAS.

Leave a Reply

Your email address will not be published. Required fields are marked *

1 + 1 =