Spotlight: Search and Be Searched

Thu,6/12 10:30

  • Uniform type identifier UTI
  • Declaring New UTIs
  • Implement Callback Function
Get metadata attributes from file
This function's job is to extract useful information your file format supports and return it as a dictionary

shared demo mdimoport -p -g files/debug/forturncookie

shared demo mdfind '(com_example_forturnID=0)'

With the new version of Leopard, Introduced some additional features.

  • With Spotlight in Tiger, users can only search devices that are attached to their computers. With Leopard, Spotlight is able to search networked Macs running Leopard (both client and server versions) that have file sharing enabled.

  • A feature calledQuick Look has been added to the GUI that will display live previews of files within the search results, so applications do not have to be opened just to confirm that the user has found the right file.

  • The syntax has also been extended to include support for boolean "AND", "OR" and "NOT" operators.

  • Spotlight is not enabled on the server version of Tiger,it is on the server release of Leopard.

  • In addition, where Spotlight in Tiger had a unique and separate window design, Spotlight in Leopard now shares windows with the Finder, allowing for a more unified GUI.

  • The unique Spotlight window in Tiger allowed sorting and viewing of search results by any metadata handled by the Finder

  • whereas Spotlight Finder windows in Leopard are fixed to view and sort items by last opened date, filename and kind only.In Leopard the Spotlight menu doubles as a calculator, very similar to the functionality of the Google search field (but without the need to be online).
NSMetadataQuery:Asynchronous

The NSMetadataQuery class encapsulates the functionality provided by the MDQuery opaque type for querying the Spotlight metadata.NSMetadataQuery objects provide metadata query results in several ways:
  • As individual attribute values for requested attributes.

  • As value lists that contain the distinct values for given attributes in the query results.

  • A result array proxy, containing all the query results. This is suitable for use with Cocoa bindings.

  • As a hierarchical collection of results, grouping together items with the same values for specified grouping attributes. This is also suitable for use with Cocoa bindings.

0 评论:

Followers