# Titanium.App.iOS.SearchableItemAttributeSet

> The SearchableItemAttributeSet module defines metadata properties for SearchItem and UserActivity objects.

- Source: https://titaniumsdk.com/docs/sdk/12.6.3/Titanium.App.iOS.SearchableItemAttributeSet
- Titanium SDK version: 12.6.3
- Kind: proxy
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Extends: Titanium.Proxy
- Inheritance: Titanium.Proxy

The SearchableItemAttributeSet object provides a large number of properties covering most common scenarios such
as files, music, video, and document searches. To effectively add and remove information from the iOS search index
you will need to use the below listed modules:

* [Titanium.App.iOS.SearchableItemAttributeSet](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.SearchableItemAttributeSet.md) - Used to create metadata related to the `Ti.App.iOS.SearchableItem`
* [Titanium.App.iOS.SearchableItem](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.SearchableItem.md) - Used to assemble metadata into a unique object package to be used by `Ti.App.iOS.SearchableIndex`
* [Titanium.App.iOS.SearchableIndex](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.SearchableIndex.md)  - Used to add and remove `Ti.App.iOS.SearchableItem` objects to the device search index

To use this feature make sure you have a compatible device running iOS 9 or later.

To create a SearchableItemAttributeSet object, use the Titanium.App.iOS.createSearchableItemAttributeSet method.
Pass a dictionary of metadata properties to the method to associate with a SearchableItem object or UserActivity.
At minimum, you must set the [itemContentType](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.SearchableItemAttributeSet.md#itemContentType) property.

Pass the SearchableItemAttributeSet object to either the Titanium.App.iOS.createSearchableItem method to the `attributeSet` key
or to a UserActivity object's [addContentAttributeSet()](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.UserActivity.md#addContentAttributeSet) method.

## Example: Add Searchable Content to the On-Device Index

The following example demonstrates how to create a new Ti.App.iOS.SearchableItem and
add a Ti.App.iOS.SearchableItemAttributeSet. The Ti.App.iOS.SearchableItem is then passed to the
Ti.App.iOS.SearchableIndex object to add it to the on-device search index.

#### app.js
``` js
var searchItems = [];
var itemAttr = Ti.App.iOS.createSearchableItemAttributeSet({
    itemContentType: Ti.App.iOS.UTTYPE_IMAGE,
    title:"Titanium Core Spotlight Tutorial"
});

itemAttr.contentDescription ="Tech Example \nOn: " + String.formatDate(new Date(),"short");
itemAttr.keywords =["Mobile","Appcelerator","Titanium"];

var item = Ti.App.iOS.createSearchableItem({
    uniqueIdentifier:"my-id",
    domainIdentifier:"com.mydomain",
    attributeSet:itemAttr
});
searchItems.push(item);

var indexer = Ti.App.iOS.createSearchableIndex();

indexer.addToDefaultSearchableIndex(searchItems,function(e){
    if(e.success){
        alert("Press the home button and now search for your keywords");
    }else{
        alert("Errored: " + JSON.stringify(e.error));
    }
});
```

## Properties

### addedDate

- Type: String
- Platforms: iPhone, iPad, macOS

The date that the item was moved into the current location.

The date will be a string in the following format: "yyyy-MM-dd'T'HH:mm:ss.SSS'+0000'"
For example, `2015-12-25T23:30:55.978+0000`

### album

- Type: String
- Platforms: iPhone, iPad, macOS

The title for a collection of media.

### alternateNames

- Type: Array<String>
- Platforms: iPhone, iPad, macOS

An array of localized strings of alternate display names for this item.

### artist

- Type: String
- Platforms: iPhone, iPad, macOS

The artist for the media.

### audiences

- Type: Array<String>
- Platforms: iPhone, iPad, macOS

A class of entity for whom the resource is intended or useful.

A class of entity may be determined by the creator, publisher
or third party.

### audioBitRate

- Type: Number
- Platforms: iPhone, iPad, macOS

The audio bit rate.

### audioChannelCount

- Type: Number
- Platforms: iPhone, iPad, macOS

The number of channels in the audio data contained in the file.

This item only represents
the number of discreet channels of audio data found in the file. It does not indicate
any configuration of the data in regards to a user's speaker setup.

### audioEncodingApplication

- Type: String
- Platforms: iPhone, iPad, macOS

The name of the application that encoded the data contained in the audio file.

### audioSampleRate

- Type: Number
- Platforms: iPhone, iPad, macOS

The sample rate of the audio data contained in the file.

The sample rate is a float value representing Hertz (audio_frames/second),
for example, 44100.0 or 22254.54.

### audioTrackNumber

- Type: Number
- Platforms: iPhone, iPad, macOS

The track number of a song/composition when it is part of an album.

### codecs

- Type: Array<String>
- Platforms: iPhone, iPad, macOS

The codecs used to encode/decode the media.

### comment

- Type: String
- Platforms: iPhone, iPad, macOS

Comment related to a file.

### composer

- Type: String
- Platforms: iPhone, iPad, macOS

The composer of the song/composition contained in the audio file.

### contactKeywords

- Type: Array<String>
- Platforms: iPhone, iPad, macOS

A list of contacts that are somehow associated with this document beyond what is captured as Author.

### containerDisplayName

- Type: String
- Platforms: iPhone, iPad, macOS

Display of the search container

### containerIdentifier

- Type: String
- Platforms: iPhone, iPad, macOS

Identifier for the search container

### containerOrder

- Type: Number
- Platforms: iPhone, iPad, macOS

Order the search container is displayed.

### containerTitle

- Type: String
- Platforms: iPhone, iPad, macOS

Title displayed in the search container

### contentCreationDate

- Type: String
- Platforms: iPhone, iPad, macOS

The date that the contents of the item were created.

The date will be a string in the following format: "yyyy-MM-dd'T'HH:mm:ss.SSS'+0000'"
For example, `2015-12-25T23:30:55.978+0000`

### contentDescription

- Type: String
- Platforms: iPhone, iPad, macOS

An account of the content of the resource.

Description may include but is not limited to: an abstract, table of contents, reference
to a graphical representation of content or a free-text account of the content.

### contentModificationDate

- Type: String
- Platforms: iPhone, iPad, macOS

The date that the contents of the item were last modified.

The date will be a string in the following format: "yyyy-MM-dd'T'HH:mm:ss.SSS'+0000'"
For example, `2015-12-25T23:30:55.978+0000`

### contentRating

- Type: Number
- Platforms: iPhone, iPad, macOS

Whether or not the item has explicit content. Set to `1` for explicit or `0` for clean.

### contentSources

- Type: Array<String>
- Platforms: iPhone, iPad, macOS

Used to indicate where the item was obtained from.

### contentType

- Type: String
- Platforms: iPhone, iPad, macOS

UTI Type pedigree for an item.

### contentTypeTree

- Type: Array<String>
- Platforms: iPhone, iPad, macOS

Array of strings related to the content tree of the item.

### contentURL

- Type: String
- Platforms: iPhone, iPad, macOS

File URL representing the content to be indexed.

### contributors

- Type: Array<String>
- Platforms: iPhone, iPad, macOS

Used to designate the entity responsible for making contributions to the content of the resource.

### copyright

- Type: String
- Platforms: iPhone, iPad, macOS

Copyright of the content.

### coverage

- Type: Array<String>
- Platforms: iPhone, iPad, macOS

Used to designate the extent or scope of the content of the resource.

### creator

- Type: String
- Platforms: iPhone, iPad, macOS

Application used to create the document content (e.g. "Word","Framemaker", etc.).

### deliveryType

- Type: Number
- Platforms: iPhone, iPad, macOS

The delivery type of the item.  Set to `0` for fast start and `1` for RTSP.

### director

- Type: String
- Platforms: iPhone, iPad, macOS

Director of the item, for example, the movie director.

### displayName

- Type: String
- Platforms: iPhone, iPad, macOS

A localized string to be displayed in the UI for this item.

### downloadedDate

- Type: String
- Platforms: iPhone, iPad, macOS

The date that the file was last downloaded / received.

The date will be a string in the following format: "yyyy-MM-dd'T'HH:mm:ss.SSS'+0000'"
For example, `2015-12-25T23:30:55.978+0000`

### duration

- Type: Number
- Platforms: iPhone, iPad, macOS

Duration in seconds of the content of the item (if appropriate).

### editors

- Type: Array<String>
- Platforms: iPhone, iPad, macOS

The list of editor/editors that have worked on this item.

### encodingApplications

- Type: Array<String>
- Platforms: iPhone, iPad, macOS

Software used to convert the original content into a PDF stream.

### fileSize

- Type: Number
- Platforms: iPhone, iPad, macOS

Size of the document in MB.

### fontNames

- Type: Array<String>
- Platforms: iPhone, iPad, macOS

Array of font names used in the item.

### fullyFormattedAddress

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 6.0.0

The fully formatted address of the item (obtained from MapKit).

### generalMIDISequence

- Type: Number
- Platforms: iPhone, iPad, macOS

Used to indicates whether the MIDI sequence contained in the file is setup for use with a General MIDI device.

Should be `1` if true and `0` otherwise.

### genre

- Type: String
- Platforms: iPhone, iPad, macOS

Genre of the item, for example, movie genre.

### identifier

- Type: String
- Platforms: iPhone, iPad, macOS

Used to reference to the resource within a given context.

Recommended best practice is to identify the resource by
means of a string or number conforming to a formal identification system.

### information

- Type: String
- Platforms: iPhone, iPad, macOS

Information about the item.

### itemContentType

- Type: String
- Platforms: iPhone, iPad, macOS

Content type of the attribute set.

Must be set to create a SearchableItemAttributeSet object.  Set to an identifier in the
[iOS Developer Library: System-Declared Uniform Type Identifiers](https://developer.apple.com/library/content/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html)

Accepts: `Titanium.App.iOS.UTTYPE_APPLE_ICNS`, `Titanium.App.iOS.UTTYPE_APPLE_PROTECTED_MPEG4_AUDIO`, `Titanium.App.iOS.UTTYPE_AUDIO`, `Titanium.App.iOS.UTTYPE_BMP`, `Titanium.App.iOS.UTTYPE_FLAT_RTFD`, `Titanium.App.iOS.UTTYPE_GIF`, `Titanium.App.iOS.UTTYPE_HTML`, `Titanium.App.iOS.UTTYPE_ICO`, `Titanium.App.iOS.UTTYPE_IMAGE`, `Titanium.App.iOS.UTTYPE_JPEG`, `Titanium.App.iOS.UTTYPE_JPEG2000`, `Titanium.App.iOS.UTTYPE_MOVIE`, `Titanium.App.iOS.UTTYPE_MP3`, `Titanium.App.iOS.UTTYPE_MPEG`, `Titanium.App.iOS.UTTYPE_MPEG4`, `Titanium.App.iOS.UTTYPE_MPEG4_AUDIO`, `Titanium.App.iOS.UTTYPE_PDF`, `Titanium.App.iOS.UTTYPE_PICT`, `Titanium.App.iOS.UTTYPE_PLAIN_TEXT`, `Titanium.App.iOS.UTTYPE_PNG`, `Titanium.App.iOS.UTTYPE_QUICKTIME_IMAGE`, `Titanium.App.iOS.UTTYPE_QUICKTIME_MOVIE`, `Titanium.App.iOS.UTTYPE_RTF`, `Titanium.App.iOS.UTTYPE_RTFD`, `Titanium.App.iOS.UTTYPE_TEXT`, `Titanium.App.iOS.UTTYPE_TIFF`, `Titanium.App.iOS.UTTYPE_TXN_TEXT_AND_MULTIMEDIA_DATA`, `Titanium.App.iOS.UTTYPE_UTF16_EXTERNAL_PLAIN_TEXT`, `Titanium.App.iOS.UTTYPE_UTF16_PLAIN_TEXT`, `Titanium.App.iOS.UTTYPE_UTF8_PLAIN_TEXT`, `Titanium.App.iOS.UTTYPE_VIDEO`, `Titanium.App.iOS.UTTYPE_WEB_ARCHIVE`, `Titanium.App.iOS.UTTYPE_XML`

### keySignature

- Type: String
- Platforms: iPhone, iPad, macOS

The musical key of the song/composition contained in an audio file.

### keywords

- Type: Array<String>
- Platforms: iPhone, iPad, macOS

Represents keywords associated with this particular item. Example keywords might be Birthday etc.

### kind

- Type: String
- Platforms: iPhone, iPad, macOS

Kind that the item represents.

### languages

- Type: Array<String>
- Platforms: iPhone, iPad, macOS

Used to designate the languages of the intellectual content of the resource.

### lastUsedDate

- Type: String
- Platforms: iPhone, iPad, macOS

The date that the item was last used.

The date will be a string in the following format: "yyyy-MM-dd'T'HH:mm:ss.SSS'+0000'"
For example, `2015-12-25T23:30:55.978+0000`

### local

- Type: Number
- Platforms: iPhone, iPad, macOS

Whether or not the item is local. Set to `1` if true and `0` otherwise.

### lyricist

- Type: String
- Platforms: iPhone, iPad, macOS

The lyricist/text writer for song/composition contained in the audio file.

### mediaTypes

- Type: Array<String>
- Platforms: iPhone, iPad, macOS

Media types present in the content.

### metadataModificationDate

- Type: String
- Platforms: iPhone, iPad, macOS

The date that the last metadata attribute was changed.

The date will be a string in the following format: "yyyy-MM-dd'T'HH:mm:ss.SSS'+0000'"
For example, `2015-12-25T23:30:55.978+0000`

### musicalGenre

- Type: String
- Platforms: iPhone, iPad, macOS

The musical genre of the song/composition contained in the audio file.

### musicalInstrumentCategory

- Type: String
- Platforms: iPhone, iPad, macOS

Metadata attribute that stores the category of instrument.

Files should have an instrument associated with
them ("Other Instrument" is provided as a catch-all). For some
categories, like "Keyboards" there are instrument names which
provide a more detailed instrument definition, for example, Piano, Organ, etc.

### musicalInstrumentName

- Type: String
- Platforms: iPhone, iPad, macOS

Metadata attribute that stores the name of instrument.

Relative to the instrument category. Files can have an
instrument name associated with them if they have certain
instrument categories, for example, the category Percussion has
multiple instruments, including Conga and Bongo.

### organizations

- Type: Array<String>
- Platforms: iPhone, iPad, macOS

Used to indicate company/Organization that created the document.

### originalFormat

- Type: String
- Platforms: iPhone, iPad, macOS

Original format of the movie.

### originalSource

- Type: String
- Platforms: iPhone, iPad, macOS

Original source of the movie.

### pageCount

- Type: Number
- Platforms: iPhone, iPad, macOS

Number of pages in the item.

### pageHeight

- Type: Number
- Platforms: iPhone, iPad, macOS

Height in points (72 points per inch) of the document page.

First page only for PDF's - other pages within the PDF may
not be the same height.

### pageWidth

- Type: Number
- Platforms: iPhone, iPad, macOS

Width in points (72 points per inch) of the document page.

First page only for PDF's - other pages within the PDF may
not be the same width.

### participants

- Type: Array<String>
- Platforms: iPhone, iPad, macOS

The list of people who are visible in an image or movie or written about in a document.

### path

- Type: String
- Platforms: iPhone, iPad, macOS

The complete path to the item.

### performers

- Type: Array<String>
- Platforms: iPhone, iPad, macOS

Performers in the movie.

### playCount

- Type: Number
- Platforms: iPhone, iPad, macOS

User play count of this item.

### postalCode

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 6.0.0

The postal code for the item according to guidelines established by the provider.

### producer

- Type: String
- Platforms: iPhone, iPad, macOS

Producer of the content.

### projects

- Type: Array<String>
- Platforms: iPhone, iPad, macOS

The list of projects that this item is part of.

### publishers

- Type: Array<String>
- Platforms: iPhone, iPad, macOS

Used to designate the entity responsible for making the resource available.

### rating

- Type: Number
- Platforms: iPhone, iPad, macOS

User rating of this item out of 5 stars.

### ratingDescription

- Type: String
- Platforms: iPhone, iPad, macOS

A description of the rating, for example, the number of reviewers.

### recordingDate

- Type: String
- Platforms: iPhone, iPad, macOS

The recording date of the song/composition.

This information differs from
the `contentCreationDate` attribute as it indicates the date that the
'art' was created, in contrast to contentCreationDate which for example, could indicate
the creation date of an edited or 'mastered' version of the original art.

The date will be a string in the following format: "yyyy-MM-dd'T'HH:mm:ss.SSS'+0000'"
For example, `2015-12-25T23:30:55.978+0000`

### relatedUniqueIdentifier

- Type: String
- Platforms: iPhone, iPad, macOS

For activities this is the unique identifier for the item this activity is related to.

### rights

- Type: Array<String>
- Platforms: iPhone, iPad, macOS

Used to provide a link to information about rights held in and over resource.

### role

- Type: String
- Platforms: iPhone, iPad, macOS

Used to indicate the role of the document creator.

### securityMethod

- Type: String
- Platforms: iPhone, iPad, macOS

Security (encryption) method used in the file.

### streamable

- Type: Number
- Platforms: iPhone, iPad, macOS

Whether the content is prepared for streaming.  Set to `0` for not streamable and `1` for streamable.

### subject

- Type: String
- Platforms: iPhone, iPad, macOS

Subject of the the item.

### subThoroughfare

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 6.0.0

The sub-location (e.g., street number) for the item according to guidelines established by the provider.

### supportsNavigation

- Type: Number
- Platforms: iPhone, iPad, macOS

Used to determine if navigation is supported.

If `supportsNavigation` is set to `1`, and the item has the `latitude` and `longitude` properties set,
then the latitude and longitude may be used for navigation. For example, `supportsNavigation`
would be set on a restaurant review, but not on a photo.

### supportsPhoneCall

- Type: Number
- Platforms: iPhone, iPad, macOS

Used to indicate that using the phone number is appropriate.

If `supportsPhoneCall` is `1` and the item has the `phoneNumbers` property set, then the phone number
may be used to initiate phone calls. This should be used to indicate that using the phone
number is appropriate, and a primary action for the user. For example, `supportsPhoneCall`
would be set on a business, but not an academic paper that happens to have phone numbers
for the authors or the institution.

### tempo

- Type: Number
- Platforms: iPhone, iPad, macOS

The tempo of the music contained in the audio file in Beats Per Minute.

### theme

- Type: String
- Platforms: iPhone, iPad, macOS

Theme of the the item.

### thoroughfare

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 6.0.0

The location (e.g., street name) for the item according to guidelines established by the provider.

### thumbnailData

- Type: String | Titanium.Blob
- Platforms: iPhone, iPad, macOS

Image data for thumbnail for this item.

### thumbnailURL

- Type: String
- Platforms: iPhone, iPad, macOS

File URL pointing to a thumbnail image for this item.

### timeSignature

- Type: String
- Platforms: iPhone, iPad, macOS

The time signature of the musical composition contained in the audio/MIDI file.

### title

- Type: String
- Platforms: iPhone, iPad, macOS

The title of the particular item.

### totalBitRate

- Type: Number
- Platforms: iPhone, iPad, macOS

The total bit rate (audio and video combined) of the media.

### url

- Type: String
- Platforms: iPhone, iPad, macOS

URL of the item.

### version

- Type: String
- Platforms: iPhone, iPad, macOS

A version specifier for this item.

### videoBitRate

- Type: Number
- Platforms: iPhone, iPad, macOS

The video bit rate.

## Inherited members

6 members are inherited. Each is documented on the type that declares it.

- [Titanium.Proxy](https://titaniumsdk.com/docs/sdk/12.6.3/Titanium.Proxy.md): `addEventListener`, `apiName`, `applyProperties`, `bubbleParent`, `fireEvent`, `removeEventListener`

---

- This corpus documents Titanium SDK 13.4.1. Anything here that does not name a version describes 13.4.1.
- Titanium is maintained by TiDev. The Appcelerator toolchain is retired: there is no `appc` CLI, no Appcelerator Studio and no hosted build service. The supported CLI is `titanium` on npm, invoked as `ti`.

