[haiku] Re: Need Some GSoC Advice

  • From: Ankur Sethi <get.me.ankur@xxxxxxxxx>
  • To: haiku@xxxxxxxxxxxxx
  • Date: Mon, 23 Mar 2009 21:53:28 +0530

I have never looked into the internal workings of Spotlight, but I
think this is more or less how it keeps its index in sync:

(1) Create an initial index of all the data on the disk. This takes a
*very* long time and consumes a large amount of CPU. Somethimes,
seemingly at random, Spotlight will decide to build the entire index
from scratch, and then there is very little you can do about it.

(2) Monitor the filesystem and update the index whenever something
changes. When I was playing with Cocoa, I found it was possible to
monitor a directory or volume for changes, and recieve notifications
about those changes as soon as they occurred (is this currently
possible in Haiku?). Large IO operations are uncommon enough to make
this approach efficient enough.

Spotlight has full-text indexing for several file formats, including
PDF, plaintext, HTML, iWork documents, ID3 tags on audio files etc.
Application authors can write plugins for Spotlight (called Spotlight
Importers) which enable Spotlight to index custom document formats.

This is also how the SkyOS Index Feeder works, guessing from their
webpage, and this is exactly the approach I have in mind for my
project. I think I might be running a bit ahead of myself though,
since I still haven't read enough about BeOS/Haiku :p

/me goes back to the Be Book.

-- 
Ankur Sethi
http://uncool.in

Other related posts: