Spotlight importer for records

  • I'd like to make Spotlight index individual records from my
    application, rather than whole files.  Some examples of this are
    Apple's own iCal, Address Book, and Mail.app.  For instance if you
    type in someone's name in the Spotlight search box, in addition to
    files which contain that name, individual Address Book entries that
    match will show up, and selecting one of them will start Address Book
    with that address showing.  I'd like to implement the same sort of
    thing for my app, but the Spotlight Importer Programming Guide just
    shows how to generate metadata for files, but not how to get Spotlight
    to treat individual records as separate files.  Can someone please
    point me in the right direction?

    Thank you,
    Adam
  • On 2 Mar '08, at 10:09 PM, Adam P Jenkins wrote:

    > I'd like to make Spotlight index individual records from my
    > application, rather than whole files.

    Spotlight doesn't support that yet. Its unit of granularity is whole
    files.

    > Some examples of this are Apple's own iCal, Address Book, and
    > Mail.app.  For instance if you type in someone's name in the
    > Spotlight search box, in addition to files which contain that name,
    > individual Address Book entries that match will show up, and
    > selecting one of them will start Address Book with that address
    > showing.

    Mail and AB do that by creating individual files for every record, for
    Spotlight to index. The ones for Address Book are stored in ~/Library/
    Application Support/Address Book/Metadata/.

    You can do the same thing yourself. It doesn't even matter what kind
    of data is in the files, as long as your importer knows how to read
    them. (For example, the AB files aren't vCards, just property lists
    containing the metadata.) Of course you have to keep these files and
    their contents in sync with your real database, which can be a pain.

    —Jens
  • Thank you for the information.  Search Kit does allow indexing
    arbitrary pieces of data that don't have to correspond to actual
    files, and since Spotlight is built on top of Search Kit I thought
    there would be some way to do the same thing.

    Thanks,
    Adam

    On Mar 3, 2008, at 1:54 AM, Jens Alfke wrote:

    >
    > On 2 Mar '08, at 10:09 PM, Adam P Jenkins wrote:
    >
    >> I'd like to make Spotlight index individual records from my
    >> application, rather than whole files.
    >
    > Spotlight doesn't support that yet. Its unit of granularity is whole
    > files.
    >
    >> Some examples of this are Apple's own iCal, Address Book, and
    >> Mail.app.  For instance if you type in someone's name in the
    >> Spotlight search box, in addition to files which contain that name,
    >> individual Address Book entries that match will show up, and
    >> selecting one of them will start Address Book with that address
    >> showing.
    >
    > Mail and AB do that by creating individual files for every record,
    > for Spotlight to index. The ones for Address Book are stored in ~/
    > Library/Application Support/Address Book/Metadata/.
    >
    > You can do the same thing yourself. It doesn't even matter what kind
    > of data is in the files, as long as your importer knows how to read
    > them. (For example, the AB files aren't vCards, just property lists
    > containing the metadata.) Of course you have to keep these files and
    > their contents in sync with your real database, which can be a pain.
    >
    > —Jens
  • On 3 Mar '08, at 5:50 AM, Adam P Jenkins wrote:

    > Thank you for the information.  Search Kit does allow indexing
    > arbitrary pieces of data that don't have to correspond to actual
    > files, and since Spotlight is built on top of Search Kit I thought
    > there would be some way to do the same thing.

    Spotlight does use SearchKit for full-text indexing of documents, but
    not for other metadata properties (filenames, ID3 tags, PDF
    authorship, image dimensions, and whatever other custom properties an
    importer might set.) So making Spotlight work on records within files
    would require a lot of architectural changes.

    It's definitely a known issue, and the Spotlight people are aware of
    its importance. I hope it'll show up in the future.

    —Jens
previous month march 2008 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Go to today