이름(앱 콘텐츠 스키마)

항목의 System.ItemNameSystem.ItemNameDisplay\ 를 지정합니다.

요소 계층 구조

<속성>
<Name>

구문

<Name>

  string

</Name>

특성 및 요소

특성

없음

자식 요소

없음

부모 요소

부모 요소 Description
속성

Windows Search 인덱스에 대한 항목을 설명하는 속성을 포함합니다.

 

이 예제에서는 "샘플 1"이라는 항목을 설명하는 간단한 appcontent-ms 파일을 보여 줍니다.

파일에 appcontent-ms 스키마 IndexerSampleInformation 로 정의되지 않은 요소 및 IndexerSampleSpecificElement. appcontent-ms 파일에는 인덱싱할 모든 데이터를 캡슐화하는 루트 노드가 있어야 하지만 원하는 모든 노드의 이름을 지정할 수 있습니다.

<?xml version="1.0" encoding="utf-8"?>
<IndexerSampleInformation>
  <Properties xmlns="http://schemas.microsoft.com/Search/2013/ApplicationContent">
    <Name>Sample 1</Name>
    <Keywords>
      <Keyword xml:lang="en-US">Sample 1 - keyword 1</Keyword>
      <Keyword>Sample 1 - keyword 2</Keyword>
    </Keywords>
    <Comment>Sample 1 comment</Comment>
    <AdditionalProperties>
      <Property Key="System.Title">Sample 1 Title</Property>
      <Property xml:lang="en-US" Key="System.Contact.EmailAddresses">
        <Value>bryan@contoso.com</Value>
        <Value>vincent@contoso.com</Value>
      </Property>
    </AdditionalProperties>
  </Properties>
  <IndexerSampleSpecificElement sc:IndexableContent="true" 
    xmlns:sc="http://schemas.microsoft.com/Search/2013/ApplicationContent">
    The text included here will be indexed, enabling full-text search.
  </IndexerSampleSpecificElement>
</IndexerSampleInformation>

Windows Search에 임의의 요소의 콘텐츠를 인덱싱하도록 지시할 수도 있습니다. IndexableContent 특성을 사용하여 Search에 콘텐츠를 인덱싱하도록 지시하기만 하면됩니다. 앞의 예제에서 Windows Search는 IndexableContent 특성이 true로 설정되어 있으므로 IndexerSampleSpecificElement의 콘텐츠를 인덱싱합니다.

  <IndexerSampleSpecificElement sc:IndexableContent="true" 
    xmlns:sc="http://schemas.microsoft.com/Search/2013/ApplicationContent">
    The text included here will be indexed, enabling full-text search.
  </IndexerSampleSpecificElement>

검색은 기본적으로 콘텐츠를 텍스트 콘텐츠로 처리합니다. 콘텐츠가 base64이면 ContentType 특성을 사용하여 MIME 형식을 지정합니다.

다음 예제에서는 appcontent-ms 파일을 앱의 LocalFolder\Indexed 폴더에 복사하는 방법을 보여줍니다. 코드는 앱의 appcontent-ms 폴더에서 찾은 모든 파일을 LocalFolder\Indexed 폴더에 복사합니다. (다른 위치에서 복사하는 대신 인덱싱된 폴더에 직접 새 appcontent-ms 파일을 만들 수도 있습니다.)

/// <summary>
/// For the purposes of this sample, the appcontent-ms files are stored in an "appcontent-ms" folder in the
/// install directory. These are then copied into the app&#39;s "LocalState\Indexed" folder, which exposes them
/// to the indexer.
/// </summary>
public async static Task<string> AddAppContentFilesToIndexedFolder()
{
    var localFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
    var installDirectory = Windows.ApplicationModel.Package.Current.InstalledLocation;
    var outputString = "Items added to the \"Indexed\" folder:";
    var appContentFolder = await installDirectory.GetFolderAsync("appcontent-ms");
    var indexedFolder = await localFolder.CreateFolderAsync(
        "Indexed", Windows.Storage.CreationCollisionOption.OpenIfExists);
    var files = await appContentFolder.GetFilesAsync();
    foreach (var file in files)
    {
        outputString += "\n" + file.DisplayName + file.FileType;
        await file.CopyAsync(indexedFolder, 
            file.Name, Windows.Storage.NameCollisionOption.ReplaceExisting);
    }
    return outputString;
}
// For the purposes of this sample, the appcontent-ms files are stored in an "appcontent-ms" folder
// in the install directory.  These are then copied into the app&#39;s "LocalState\Indexed" folder,
// which exposes them to the indexer.
function _addAppContentFilesToIndexedFolder() {
    var localFolder = appData.localFolder,
        appcontentFolder,
        indexedFolder,
        installDirectory = Windows.ApplicationModel.Package.current.installedLocation;
    var output = "Items added to the \"Indexed\" folder:\n";
    installDirectory.getFolderAsync("appcontent-ms").then(function (retrievedAppcontentFolder) {
        appcontentFolder = retrievedAppcontentFolder;
        return localFolder.createFolderAsync(
            "Indexed", Windows.Storage.CreationCollisionOption.openIfExists);
    }).then(function (retrievedIndexedFolder) {
        indexedFolder = retrievedIndexedFolder;
        return appcontentFolder.getFilesAsync(appcontentFolder);
    }).then(function (files) {
        var promiseArray = [];
        for (var i = 0, len = files.length; i < len; i++) {
            promiseArray[i] = files[i].copyAsync(indexedFolder, 
                files[i].name, Windows.Storage.NameCollisionOption.replaceExisting);
            output += files[i].displayName + files[i].fileType;
            if (i < len - 1) {
                output += "\n";
            }
        }
        return WinJS.Promise.join(promiseArray);
    }).done(function () {
        WinJS.log &amp;&amp; WinJS.log(output, "sample", "status");
    });
}

전체 코드는 인덱서 샘플을 참조하세요.

참고 항목

인덱서 샘플

Windows. Storage. 검색

요구 사항

Namespace http://schemas.microsoft.com/Search/2013/ApplicationContent