Sunday, April 5, 2009

Search Your Computer

Have Beagle find and fetch your information faster than you thought possible.
One of Linux's weaker points as a desktop OS has been the lack of a search feature. Nautilus has had a "find this file" function for quite some time, but it's really not much more sophisticated than a GUI wrapper around the command-line find command. Both Nautilus and the find command do similar things: they'll look at each and every file in the directory structure, trying to find a match for the criteria you've given them.
There is a better way to search a filesystem. It involves creating an index of all the files on that filesystem, which enables you to search the index much like you would a database. This is what Windows and Mac OS X do for their file-search capabilities, and now Linux has it too in the form of Beagle, a modular search engine that's written in Mono. It's easy to add Beagle to Ubuntu, and the usability benefits are tremendous.
Installing Beagle
In this hack, you'll be installing Beagle and a very cool search frontend known as deskbar-applet. deskbar-applet sits in your GNOME panel and enables all manner of search goodness for you. As with many optional goodies, you'll need to have the universe repository enabled to install both of these packages. Now, open up a terminal and install beagle and deskbar-applet:

:~$ sudo aptitude install beagle deskbar-applet

Starting beagled
Once you've got beagle and deskbar-applet installed, you'll need to start beagled (the main engine and database) manually. From a terminal, you'll simply run beagled. It should start and detach from your terminal, and run in the background:

:~$ beagled

It will then begin the process of indexing your hard disk(s). This will take a while, depending on the amount and type of data you have. We have seen beagled take up to three hours to fully index a disk. If you're running beagled on a laptop, you may want to make sure it's plugged into AC power, because the high I/O from beagled's initial indexing could drain your battery. While beagled is indexing, you can set up your GNOME desktop to automatically start beagled when you log in. Simply click on the System Menu, and select Preferences and then Sessions. Add beagled to your Startup Programs, and it will be ready to fetch stuff for you on your next login.

Using Beagle and deskbar-applet
Now that the Beagle daemon is running, it's time to add deskbar-applet to the mix. The deskbar applet is a GNOME applet, so add it to one of the GNOME panels by right-clicking on the panel and selecting "Add to Panel." Select Deskbar, click Add, and then close the window. You'll see the deskbar in your panel now.
At this point, you can put criteria into the deskbar applet and go ahead and search for something If you put your search criteria in the applet and click the little magnifying glass, you can tell the deskbar applet to search any one of a number of databases, including Beagle, which is not enabled by default. (The default search can be changed in the preferences for deskbar-applet; simply right-click on the applet and select Preferences to adjust it.)
Once you click on "Search for...using Beagle," Beagle takes over, digging through its index and fetching the proper results. By default, Beagle will search the files in your home directory, as well as metadata like email archives, instant messages, and blog posts. It doesn't matter where the data is; Beagle will fetch it for you


 

Gadget Copyright © 2009 WoodMag is Designed by Ipietoon for Free Blogger Template