Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.4: Use Spotlight as a quick and dirty database Apps
Tiger only hintSpotlight does not index network volumes, so in a workgroup environment where all the 'interesting' documents are on a network volume, it's not very useful. However, since Spotlight will index the contents of files on your hard drive, we can leverage this in a brute-force kluge to get some information on our interesting documents or phone lists.
  • Searching for people will show the contact's name in Spotlight. However, if I just want a phone number, I have to select that contact which opens Address Book. However, you can change your frequently-used Address Book entries to include the phone number in the name. Instead of just "George Washington" in the name field, add a suffix with his phone number. "George Washington 555-1776," for instance, will show up in Spotlight's search field, no opening of the app is necessary.

  • I need to know the status of particular parts in our database, and whether we've made PDF files of them. From our database, I selected those parts which match a particular criteria, and exported just the part numbers into a text file and named the text file something like --Sent to Vendor.txt and save it on my hard disk. (Other text files for useful criteria I've used are --Obsolete.txt, --Proofs Received.txt and --Superceded by other parts.txt.)

    Now, if I search Spotlight and enter a part number, if that number is in any of these text files then my "criteria" files shows up in the quick results window. I can tell immediately if the part is obsolete or not, sent to vendor or not, etc. without even opening the database. Of course, this is only as current as the last export of the text file, but if you can live with that, it's a very quick-and-dirty way to categorize any bits of text you want, regardless of where the data lives. (Opening and re-saving the text files every so often will make sure they float to the top of the heap of results.)

  • I've got a couple thousand files (named with our Part Number) on a network volume that I need to refer to frequently. I made a folder on my hard disk with aliases to all those files. Now entering the Part Number into Spotlight will give me an idea of the category/status of the part and show me the alias -- I don't have to scroll through whatever folder structure the file is stuck in. Once again, this is only as current as the list of aliases, but if a part doesn't show up, then you will need to dig out your regular search tools.
I want to eventually set up an Automator workflow, or a folder action, to let me know when I need to update my crude indexes, but this can give a nice snapshot of what's what, especially useful for archived or infrequently accessed items.
  • Currently 1.75 / 5
  You rated: 1 / 5 (4 votes cast)

10.4: Use Spotlight as a quick and dirty database | 10 comments | Create New Account
Click here to return to the '10.4: Use Spotlight as a quick and dirty database' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Use Spotlight as a quick and dirty database
Authored by: Mikey-San on Oct 18, '05 08:01:12AM

[ Reply to This | # ]
10.4: Use Spotlight as a quick and dirty database
Authored by: waded on Oct 18, '05 12:39:48PM

As "ew" as this usage may sound, why can't I hit Cmd-Spacebar, type any question about <b>anything</b>, and get an answer? Who cares what file, database, or part of the internet the answer has to come from? Shouldn't Spotlight be so smart?

I wouldn't be surprised if Spotlight is able to act as a front-end to actual databases in the future, thus getting it closer to being able to answer these questions. Sure, there would be a boatload of configuration behind that, but it can be taken care of at the workgroup, corporate, or internet level. For now, you have to hack it in at the personal level. Ew indeed... but they'll fix that.

[ Reply to This | # ]
10.4: Use Spotlight as a quick and dirty database
Authored by: shrek on Oct 18, '05 08:14:51AM

in stead of making suffixes for the addressbook items, why not simply use the dashboard widget for addresses, is a fast way to search for a contact if you ask me...

[ Reply to This | # ]
10.4: Use Spotlight as a quick and dirty database
Authored by: klktrk on Oct 18, '05 08:24:13AM

Sounds like your company could use a good database, for real.

There are lots of really phenomenal free ones, like MySQL, postgreSQL, SQLLite (built into the core of Mac OS X), etc. Then there's always the very easy to use but not free FileMaker, which tons of small Mac-centered businesses swear by. Or, make your own database app using XCode and the built in SQLite libraries. You can write a basic app without knowing a jot of Objective C (Yes, that's true).

Putting phone numbers in the name field is a great way to eventually make your data useless. The more discrete and uniform your data is, the more versatile a resource it can be for your company.

[ Reply to This | # ]
10.4: Use Spotlight as a quick and dirty database
Authored by: meikokun on Oct 18, '05 09:42:47AM

I beg to differ, but spotlight DOES index network volumes. Took me forever to stop the bloody thing from indexing a shared drive - it was annoying when connected on the lan, infuriating when connecting via the net. Had to resort to a shareware app in the end to stop the indexing, as dragging the networked volume to the spotlight ignore tab in preferences would only stop it for that mount period - the next time it mounted, off it would go again, indexing away.
Dunno what was up with my settings, but it wasn't just on my comp I had this 'feature' (some here evidently see it as a bonus..)

[ Reply to This | # ]
10.4: Use Spotlight as a quick and dirty database
Authored by: lar3ry on Oct 18, '05 11:58:46AM
iF you have Apple's X11 installed, you might find the oft-overlooked utility "lndir" to be handy.

Simply create a directory, and then invoke this utility and point it to a directory tree, and it will create what it calls a "shadow directory tree" of the original directory in that the new directory will contain symbolic liks pointing at the real files.


$ mkdir ~/parts
$ lndir /Network/MySharedServer/PartsNumbers ~/parts

The above two lines will create a shadow directory called "parts" in your HOME directory that contains symlinks to all the files on the network share. If the original directory has subdirectories, the directory tree in the new directory will be constructed in the same format, with each file pointing to the appropriate file.

The nice part about this utility is that you can run this script regularly, say every hour or a midnight (depending on how often your network file structure is bound to change), and it will create new symlinks and directories as needed. Alternatively, your nightly/hourly script can remove the ~/parts subdirectory before it is run, ensuring that files deleted from the share are deleted in the shadow directory as well.

Despite one respondant's cry of "EEEW!" regarding your solution, it has good merit. Symlinks don't take up too much space, and it allows you to selectively determine WHAT you want Spotlight to index on your system. Personally, I wouldn't want Spotlight to index every item on my shared network folders... only those that I might have an interest in finding on my Tiger system.

I hope this helps!


[ Reply to This | # ]

10.4: Use Spotlight as a quick and dirty database
Authored by: frickster on Oct 18, '05 04:33:37PM

Surely it does index mounted volumes. I have a Novell Netware server at work that was happily indexed by Spotlight when I mounted the drive for the first time. Now I can search the mounted volume for anything, really, and it's great -- no more "Where the bloody **** did that file go?!??""


[ Reply to This | # ]
Spotlight indexing network volumes?
Authored by: sjk on Oct 18, '05 11:03:40PM

Interesting... Spotlight has never indexed my AFP-mounted network volumes. Maybe it's because they're already indexed (or kept from being indexed) on the server-side?

[ Reply to This | # ]
Spotlight indexing network volumes?
Authored by: adamprall on Sep 22, '07 02:40:17PM


--- New Media Hawaii

[ Reply to This | # ]
Quicksilver still has a place
Authored by: tuggle on Oct 19, '05 11:23:44AM

In my opinion, the need to "browse" or take various "actions" on Spotlight results shows the continued need for Quicksilver. Quicksilver allows you to browse within your search results, and allows you to take various "actions" such as showing a phone number on the screen in bold, or sending an email to a contact.

Not to mention it's about 16 times faster than Spotlight for the most common tasks!

[ Reply to This | # ]