Insight: Work so far…
Insight is progressing, but slowly. I’m working on the first prototype, which should essentially prove the concept of the indexing system. It turns out that writing a B+ tree is more awkward than I had thought, which is slightly depressing, as that is meant to be the easy bit! Then again, once the tree is done, it should be plain sailing for a little while.
I had my second marker meeting last Wednesday, which went well. I do need to find a way to explain Insight very quickly, however. People tend to look blankly at me and say “Why would I need this?” to begin with, then they might say something like “What about Spotlight/other indexing service?” or “Why in the file system?” but once I fully explain some of its potential, they get quite excited.
One of the many things I will need to think about is how to represent synonyms. Say, for example, that you wanted course.dist-alg to be equivalent to course."Distributed Algorithms". You would need to have some way of stating that, and of choosing a primary representation. Again, you might want type.photo to be equivalent to type.image and type.picture. I think the way to do that would be using an alias flag in the index tree, and having the first few bytes in the inode area as a pointer to the primary representation. Whether I’ll implement this in time or not is another matter 🙂
Another thing I was thinking about: dynamic values in queries. Say, for example, you want to have a pretty complex query. For example, you’re a lecturer and you want a certain folder to always display the slides for the current lecture time. You want to do something like:
/lecture slides/course:{ SWITCH([now().day,now().hour], [[['Mon',11],'multi-agent'], [['Mon',12],'multi-agent'], [['Tue',14],'dist-alg'], [['Thu',10],'graphics'], [['Thu',11],'graphics'], [['Thu',16],'dist-alg'], [['Thu',17],'dist-alg'], [['Fri',10],'multi-agent'], [['Fri',11],'multi-agent'], [['Fri',12],'multi-agent'], [['Fri',14],'graphics']], '') }
… although that’s a fairly long-winded way of going about it. This represents dynamic code (delimted by braces) executing the SWITCH() function, which takes three arguments. The first is an item to find, the second is a list of two-element lists, and the third is the default to use if nothing is found. The first element is pattern-matched against the first argument of SWITCH(), and the second element will be returned by the function if the first matches.
Of course, this is just very rough, random and unstructured code, but it hopefully shows off some of the future possibilities for Insight.
Leave a Reply