This View Indexer Thing Might Be Worth Some Time

Sun Aug 05 16:51:00 EDT 2012

Tags: java views crazy
  1. I Went Crazy and Made a Small View Indexer
  2. This View Indexer Thing Might Be Worth Some Time

I've put a little more time into my small view indexer from the other day, and it seems even more promising now. The editor I made for it might give you some idea of the potential:

Fancy View Builder

Since the view building is all being done in Java, I decided to toss in the list of available JSR-223-compliant scripting languages currently available. The scripting context is given a variable "doc" that's a DocumentWrapper class I wrote that implements Map to make its use a bit easier. For added fun, I baked in knowledge of serialized Java objects stored in the document's items:

Fancy View Objects

Normally, the wrapper just returns the value of getItemValue(...), but when it encounters a MIME entity of type "application/x-java-serialized-object", it deserializes it and returns that instead, allowing for real structured data access.

I also realized that I don't have any reason to stick to only objects available in the stock JDK for index storage. Since using this will require extra Java code anyway, I may as well make my life easier and write my own "view entry" class. Once I get that sorted out, I can work on keeping the indexes updated with a server task, dealing with reader fields, and physical storage.

Hmm, maybe I should make myself an editor for normal views that looks like this one. It'd probably be a lot less hassle to deal with than the legacy one.

Commenter Photo

Karsten Lehmann - Sun Aug 05 19:17:29 EDT 2012

Ever thought about using a different NoSQL database than Lotus Notes, e.g. MongoDB or an external indexer like Lucene?

They already contain a lot of nice indexing features, like geospatial queries and dynamic sorting.

We used Lucene as an indexer for a project where Domino provides a rest service to store data. That rest service writes data into the Notes DB and updates the Lucene index at the same time. We then use Lucene's query language to find a list of documents for the search criteria and fetch them from the Notes DB.

If you implement your own indexer and store the whole index in memory, you will soon face stability issues when dealing with large amounts of data.

New Comment